Fluent Entity Framework Mapping - c#

Is there any way to perform Fluent EF Mapping like Fluent NHibernate for NHibernate ?

Entity Framework v4.0 introduces the Code Only concept which is really close to Fluent NHibernate. More information is available here and here in the ADO.NET team blog

Related

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+

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.

What is the Major Difference between Entity Framework of ASP.Net 4.0 and Entity Classes which is written by developer?

Before entity Framework, Developer was writing the code Entity Classes which is contains the getter & Setters Method for Data Table Fields (Columns).
what is the purpose of introduce Entity Framework, and what's different between Entity Framework and Older traditional way to write down Entity Classes?
If you do not use EF (or any other ORM tool), you will have to write both entity classes and related database operations by hand.
ORM tools creates both entity classes and an abstraction of related DB operations automatically.
In case of EF, it creates entity classes and an ObjectContext (or a DBContext) which allows you to manipulate DB entities without writing SQL code.
Entity Framework provides ORM capabilites to Entity Classes. You don't need to craft CRUD or Database operations on database layer, EntityFramework handles it.

How do set up PostgreSQL + entity framweork?

The npgsql ado.net provider claims to support the entity framework.
Is there any documentation/guide how to set this up, and get me jump started here ?
Look at this stackoveflow question
Entity framework PostgreSQL
You may have more luck using NHibernate with NHibernate Linq with PostgreSQL

Persistance Ignorance Linq to SQL

I have an existing domain layer. I want to develop the persistence layer using Linq to SQL. I am currently using an external map file. I am trying to use lazy loading for my child collections but am unsuccessful. Is there a way to implement lazy loading using Linq to SQL but without using EntitySet or EntityRef.
I can't guarantee that I'm up to the latest development of LTS, but previously you had to you use EntitySet/EntityRef to get lazy loading.
You're best bet is NHibernate if you want a PI-model.
(Not really answering the question.)
Entity Framework (aka. LINQ to Entities) in .NET 4 includes persistence ignorance support e.g. being able to map to POCO (Plain Old CLR Object1). See "Sneak Preview: Persistence Ignorance and POCO in Entity Framework 4.0 ".
1 I.e. Not requiring a base class or attributes.

Categories

Resources