Last post Feb 17, 2019 08:47 PM by Balaure
Feb 16, 2019 11:07 PM|Balaure|LINK
I'm trying to do a little personnal project, and I want to translate this uml class diagram into several class with the foreign key, primary key and so on.
Feb 17, 2019 05:16 PM|DA924|LINK
1) The diagram is not in English so it's hard to understand.
2) Is EF6 being used?
3) Is this an existing database being used?
4) You're using EF Code First trying to build the EF virtual object model. I don't use EF Code Frist so I can't help you there, becuase I mainly use EF DB First.
Feb 17, 2019 06:34 PM|Balaure|LINK
First of all, thank you.
2) I don't really know how I know if EF6 is usedn how can I know ? Our teacher gived us this diagram, and told us to make a web .net core 2.2 which be able to do some stuff (in this case a time schedule of the class here is a example after the anwser)
3) No, I need to create from the begining
4) The problem is, we had 3 class of .NET, and she told us to do that. I don't really know what is EF or whatever.
What I want to do is just to create this class diagram into my .cs files. The problem is the foreign key, I don't really know when I should put one and so on.
Class schedule example
Feb 17, 2019 08:35 PM|DA924|LINK
Then you should be using EF Core Code First based on what you have shown.
This is a classic problem as I see it that a developer of any sort doesn't know basic database administration by using database administration tools, or in general, the developer doesn't even understand what a relational database is about and how to use
one effectively from an administration standpoint. If developer doesn't know the database administration basics on how to create a database, how to create the database tables and making relationships between the tables and how to do CRUD by using T-SQL scripts
and using a database administration tool like SSMS, then how can the developer write C# or any other programming language or database frameworks and do it effectively?
The problem is, we had 3 class of .NET, and she told us to do that. I don't really know what is EF or whatever.
You look to be using EF Code first. I can't tell you how to do classes in using EF Code First, becuase I don't use EF Code First. I use EF Database First that makes all of the classes for me, even with EF Core so that I don't have to do it manually. Where
I would start would be to use MS SQL Server Management Studio, create the database tables and then apply relationships to them, test it out by doing create, read, update and delete (CRUD) operations with data against the tables using some test scripts using
SSMS and then I would use EF DB first and point to the database to make the virtual object model classes the ORM will use so I could write C# code using EF against the MS SQL Server Database tables.
On the other hand, how can you complete the task/assignment if you really don't know the technology you are using and how to use it, like using a relation database like MS SQL Server or a Oject Relational Mapper, an ORM, like the ADO.NET Entity Framework?
Have you ever taken a database administration class? The ORM EF should be a separate class itself.
I have to question the schooling that you are receiving from the school, or maybe, concerns on what courses you are taking to become a software developer.
No offence to you, but it is what it is.
Feb 17, 2019 08:47 PM|Balaure|LINK
2) I'll check EF Core Code First.
3) What I know is that I need to create every .cs class from the class diagram, I just need to read the diagram, like I did, but I don't remember when I need to use the foreign key and so on.
When I do the class, I'm creating the CRUD Page, and then I'm doing "add-migration Test" and then "update-database -verbose" (in the NuGet package manager) and that create the database for me.
I did have database administration class, 2 years ago, I'll try to remember what I learnt and think where I did a mistake with the foreign key
I agree with you, the schooling that I receive are not that good.
Thanks for your help, I'll try to find where I did a mistake