0

I am using code first approach in Entity Framework. I have a poco class that I want to map on a database but I use the same class to bind the data to my UI hence it contains some extra attributes. I want to map some attributes of the class to database but not all of them but I am unable to do that! Any solution

When the class attributes are equal to table column it works completely fine

1
  • 1
    Welcome to SO! You should go ahead and read "How to ask a question?" which will help you improve your question. Commented Jan 15, 2015 at 7:50

1 Answer 1

0

You should use NotMapped attribute:

public class Entity
{
    public int Id {get; set;} 

    [NotMapped]
    public string NotMapped {get;set;}
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.