Top "Entity-framework-4.1" questions

This tag is for the ADO.

StringLength vs MaxLength attributes ASP.NET MVC with Entity Framework EF Code First

What is the difference in behavior of [MaxLength] and [StringLength] attributes? As far as I can tell (with the exception …

asp.net-mvc-3 ef-code-first entity-framework-4.1
Entity framework code-first null foreign key

I have a User < Country model. A user belongs to a country, but may not belong to any (null …

entity-framework mapping ef-code-first foreign-key-relationship entity-framework-4.1
How do I detach objects in Entity Framework Code First?

There is no Detach(object entity) on the DbContext. Do I have the ability to detach objects on EF code …

entity-framework entity-framework-4.1 ef-code-first
What effect(s) can the virtual keyword have in Entity Framework 4.1 POCO Code First?

Does the virtual keyword has an effect when used on the properties in EF Code First?. Can someone describe all …

entity-framework-4 ef-code-first entity-framework-4.1
An error occurred while saving entities that do not expose foreign key properties for their relationships

I have a simply code in Entity Framework 4.1 code first: PasmISOContext db = new PasmISOContext(); var user = new User(); user.CreationDate = …

c# entity-framework ef-code-first entity-framework-4.1
Unique key with EF code first

I have a following model in my project public class Category { public Guid ID { get; set; } [Required(ErrorMessage = "Title cannot …

c# ef-code-first entity-framework-4.1 unique-key
Get a list of elements by their ID in entity framework

How can I get all elements that are in another list by ID? For eg; I have List roles; I'd …

c# .net ef-code-first entity-framework-4.1
Get Record ID in Entity Framework after insert

I'm developing an ASP.net application using Entity Framework. I'm using DetailsView to insert data into database. There is a …

asp.net entity-framework-4.1 detailsview
Generic Way to Check If Entity Exists In Entity Framework?

Similar to Best way to check if object exists in Entity Framework? I'm looking for a generic way to check …

c# generics entity-framework-4.1
Get Auto Identity Key after Insert via EF

Is there a straight forward way of retrieving a DB auto generated primary key when adding a record via Entity …

entity-framework entity-framework-4.1 dbcontext