Last post Aug 24, 2018 10:25 AM by yogyogi
Jul 25, 2018 03:41 AM|TinVin727|LINK
Hi Good day,
I'am a .net developer and i use .net framework 4.6. I always used database first code first of entity framework I like that stuff beacuse it cant create edmx file like database first did and create a model class like what created in code first and that was
pretty smoth and clean for me. Another thing is when I update my database (eg. add table or column) only thing i can do is to create a class same structure to may database table and put an attribute for eg ( [Table("SampleTable")] ) then it automatically
Now my question is it is possible to do this stuff in .net core? I'am planning to migrate my web app. Is this another way ? Please guide for this one . Thank you
Jul 25, 2018 04:48 AM|vahid bakkhi|LINK
please follow below links:
Jul 25, 2018 10:35 AM|DA924|LINK
There is no more edmx using EF core. So in my opinion, it really doesn't matter if you use DB first or code first. I have not used EF Core code first, but I am using EF Core DB First if ASP.NET Core MVC solution based on what I learned from this tutorial.
EF Core DB first still allows one to point to the an existing database schema to create the context class representing the virtual object model.
Jul 31, 2018 02:20 PM|vinz|LINK
is it is possible to do this stuff in .net core?
Yes and I wrote a getting started tutorial about it here:
Getting Started with Entity Framework Core - Database First Development
One thing to keep in mind is that the old-fashioned Entity Framework designer (.EDMX) isn’t supported in ASP.NET Core 1.1. Instead you need need to use the CLI commands to generate classes/models from your existing database.
Aug 24, 2018 10:25 AM|yogyogi|LINK
Gone are the days of .EDMX file in ASP.NET Core MVC. This is done becuase .EDMX file is a burden and difficult to handle, also it gets corrupted many times during development.
Database-First Approach is supported in EF Core but it is not strong enough. Microsoft has now put the emphasis on
Code-First Approach in Entity Framework is the way you now work on EF Core. You create the classes, then put the required field, key, relationship using Fluent API
or Data Annotation and then do the migrations. Migration will create your database with tables according to your classes.
Code-First is very strong in EF core and working is very simple.
I would strongly suggest you to follow the Code-First approach only.