Last post Apr 08, 2019 03:44 PM by Naushad Ansari
Apr 08, 2019 08:55 AM|Naushad Ansari|LINK
I am learning ASP .NET CORE 2.2 with ORM "Entity Framework Core-DATABASE First approach".
Can You please suggest me that how good it is compare to ADO .net.
I am facing a problem in migration, I have existing database now I am creating new table when I am doing Scaffolding it is saying ..
The following file(s) already exist in directory N:\LEARNING PROJECTS\EFDBFIRSTCRUD\EFDBFIRSTCRUD\Models: BlogDBContext.cs,Category.cs,Post.cs. Use the Force flag to overwrite these files.
What to do how can I build model only for my new table.
Please share some tutorial which can help me beginning to advance.
Thanks & Regards
Apr 08, 2019 09:27 AM|PatriceSc|LINK
As pointed by the error message you have to use the -Force flag if you want to override previously scaffolded files (make sure first this is what you want and to never update automatically generated files) :
With ADO.NET you are using specialized db objects to interact with the database (connections, commands, readers etc...). EF hides this behind the scene and you are working with .NET objects being a much more direct representation of data stored inside your
Apr 08, 2019 10:11 AM|Naushad Ansari|LINK
I strongly appreciate your quick response.
If I will use-Force it will drop and recreate my DbContext so again I have to re-write my code.
I need something which will update my DbContext with new table without removing existing things.
Apr 08, 2019 02:09 PM|bruce (sqlwork.com)|LINK
Apr 08, 2019 03:44 PM|Naushad Ansari|LINK