Using ADO.net Entity Framework 4 with Enumerations? How do I do it ?

Posted by Perpetualcoder on Stack Overflow See other posts from Stack Overflow or by Perpetualcoder
Published on 2010-01-14T16:20:48Z Indexed on 2010/04/06 22:23 UTC
Read the original article Hit count: 740

Question 1: I am playing around with EF4 and I have a model class like :

public class Candidate {

public int Id {get;set;}
public string FullName {get;set;}
public Gender Sex {get;set;}
public EducationLevel HighestDegreeType {get;set;}
}

Here Gender and EducationLevel are Enums like:

public enum Gender {Male,Female,Undisclosed}
public enum EducationLevel {HighSchool,Bachelors,Masters,Doctorate}

How do I get the Candidate Class and Gender and EducationLevel working with EF4 if:

  • I do model first development
  • I do db first development

Edit: Moved question related to object context to another question here.

© Stack Overflow or respective owner

Related posts about entity-framework

Related posts about entity-framework-4