Is Entity framework only for web applications? - c#

Many tutorials on Entity framework are related to web-based application. But is Entity only for the web?
Can the regular windows based client application, or any other application built using c#.net for that matter, use Entity as an abstraction for DB connectivity?

Entity Framework is a very sophisticated ORM (Object Relational Mapper) which allows complex mappings between Database tables and .NET Framework classes. It is not bound to any specific project type, or even any specific .NET language. You can use Entity Framework with C#, F#, VB.NET, and even Python, if your library is built correctly.

Related

How can I map my entity to a table in .Net Core project without using Entity Framework and only using ADO.NET

I have a project for Entities and I am using ADO.NET code for normal CRUD operations on this entity. I would like to map my entity name to table names, Could you please provide me a way to do it. With .Net Standard I could use System.Data.Linq.Mapping. But my project is in .Net Core 2.2 and I cannot add these as a reference, tried changing target framework, but my other projects are not compatible. Kindly advise me how do I do it.
I can see a couple of options.
1) Create a Mapper class that accepts T1 & T2.. And do the mapping manually for each property.
2) Use a library such as Automapper that does all this for you automatically (https://github.com/AutoMapper/AutoMapper)

Is it mandatory to use Linq when using entity framework?

I am using entity framework for my project. I just started reading about entity framework. Is it necessary to use LINQ? When I am looking at this website, it does not use LINQ anywhere. So, are there two ways of using EF- with and without LINQ?
link to the tutorial
http://www.entityframeworktutorial.net/EntityFramework4.3/Introduction.aspx
Quoting from "What is Entity Framework" in the link you provided:
The Microsoft ADO.NET Entity Framework is an Object/Relational Mapping
(ORM) framework that enables developers to work with relational data
as domain-specific objects, eliminating the need for most of the data
access plumbing code that developers usually need to write. Using the
Entity Framework, developers issue queries using LINQ, then retrieve
and manipulate data as strongly typed objects. The Entity Framework’s
ORM implementation provides services like change tracking, identity
resolution, lazy loading, and query translation so that developers can
focus on their application-specific business logic rather than the
data access fundamentals.
Its not mandatory to use LINQ while using entity framework.
But it would make things easier if you know the syntax of LINQ and take advantage of functionality it gives.
Is it possible to use Entity Framework without LINQ?
http://forums.asp.net/t/1948335.aspx?Can+I+Learn+or+Use+Entity+Framework+Without+Knowing+LINQ+To+SQL+

Entity Framework web or Entity Object

I have got a assignment question from my college, there is a line as follows
This must be implemented using C# and utilize the Entity Framework classes.
this means Entity Objects or Entity Framework??
and can I implement Entity Framework as a C# desktop application
please help me to understand this. thank you
Yes you can use Entity framework for desktop application. Create one project as desktop application and add another as the business logic project, this should be one that uses entity framework objects to communicate with your database. Lastly, another project that will implement all your desired methods in relation to the entity framework project. This is the project that the windows application communicate with directly. Check out here for some tutorial
You can combine it as one project but I prefer separation of concern so you can compile the business logic as a dll. Entity framework is just one of the object relation mapping model and it can be used across various projects types. Others include NHibernate, LINQ to SQL etc
it is a library that can be used either on web or desktop .NET project: You can get it here

EF class context

I have Microsoft VS 2010.In C# for retrieving data from database i use Ado.Net entity data model.This is Entity Framework?
I see in many articles that context created by Entity Framework is derived from dbContext but in my project context is derived form ObjectContext .
So, what is EF?
EF 4.0 (which is part of the .net Framework) uses System.Data.Entities.ObjectContext from EF 4.3 (which was Opensourced project and is not part of the Framework) onwards uses System.Data.Entities.DbContext.
Both are EntityFramework. One is newer. Both uses ADO.NET under the covers.
Yes, it is Entity Framework. However, context should be derived from ObjectContext. The ObjectSet
Represents a typed entity set that is used to perform create, read,
update, and delete operations.
and it was introduced in .NET 4.0
You may also take a look on this for additional information on object sets.

Entity Framework 3.5 or 4.0?

I'm starting a new project and the client wants to use the Entity Framework for their business layer. They are currently using .NET Framework 3.5. Would it be worth it to upgrade to 4.0 for the Entity Framework? What are the significant changes between the two versions?
Entity 4.0 supports POCO (Plain Old CLR Objects), which is a big plus if you do model-first (as opposed to database-first) development such as Domain Driven Design.
Here is an article that compares Entity 1.0 to 4.0. Regarding 4.0, it states (and discuses) the following new features:
Persistence Ignorance
POCO (Plain Old CLR Object)
T4 Code Generation
Self-Tracking Entities
Model-First Development
FK Associations
Code-only

Categories

Resources