Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.



Programming and Learning from SD

I wanted to add a property to send to my JavaScript class through WebApi, but didn’t want it in the database. I was getting an error telling me I had an invalid name on the EF 5 selection from the database. Adding the NotMapped attribute to the property did the trick. I get it on the JavaScript side as well. I found the answer (again) on StackOverflow.

Example:

public partial class ComponentAttribute
{
    [NotMapped]
    public bool IsModified { get; set; }
}
Posted on Wednesday, May 15, 2013 4:32 PM Entity Framework | Back to top


Comments on this post: Use the NotMapped Attribute with Entity Framework in Partial Classes

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net