How to resolve development issue in C# Entity Framework ? - CodingPot | Programming Blog - C#, VB.Net, ASP.Net, MVC, Angularjs Tutorials

Tuesday, 5 September 2017

How to resolve development issue in C# Entity Framework ?

What is Entity Framework?

Entity Framework (EF) is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write.
Entity framework is an Object/Relational Mapping (O/RM) framework. It is an enhancement to ADO.NET that gives developers an automated mechanism for accessing & storing the data in the database.


What is O/RM ?

ORM is a tool for storing data from domain objects to relational database like MS SQL Server, in an automated way, without much programming. O/RM includes three main parts: Domain class objects, Relational database objects and Mapping information on how domain objects map to relational database objects (tables, views & storedprocedures) It also automates standard CRUD operation (Create, Read, Update & Delete) so that the developer doesn't need to write it manually. Please note that Entity Framework is an open source framework by Microsoft. Visit wikipedia for more information on Object-relational Mapping

How to install EntityFramework 6.1.3 in asp.net MVC?

Try to use the Nuget command line to remove the installed version and it's dependencies by running this command Uninstall-Package EntityFramework but you will need to remove the dependent library Microsoft.AspNet.Identity.EntityFramework as well.
Make sure you have the right project(s) selected in the Nugetmanager command window and try this commands in this order: 1. Uninstall-Package Microsoft.AspNet.Identity.EntityFramework
2. Uninstall-Package EntityFramework
3. Install-Package Microsoft.AspNet.Identity.EntityFramework
last command will install last version of EF as well.
References...

EntityFramework Migration Specify web.config

Web.config is where the connection string should be found. Web.release.config and Web.debug.config are configuration transformations based on the current "Solution Configuration". The short answer is, of course the connection string is expected to be in Web.config, because that's where it's designed to live. You can use the -ConnectionStringName or -ConnectionString parameter on Update-Database to specify a different connection for the migrations.
References...

How to write simple query of EntityFramework?


public partial class YourContextName { public int GetMaxSNumber() { return this.Child.Max(c => c.SNumber); } }
Notes: Above all the posts are related to Entity Framework. These above issues are listed from stackoverflow site and you can see more issue details of Entity Framework on stackoverflow site.

No comments:

Post a Comment