-1

What's that attribute that you annotate your model property with to tell EF that please don't look for this field in the database and please don't map it to anything in the database. This is just in the conceptual model?

4

1 回答 1

1

[未映射]

http://msdn.microsoftcom/en-us/library/system.componentmodel.dataannotations.schema.notmappedattribute.aspx

namespace Models
{

  public partial class Foo
  {
    public virtual string FirstName { get; set; }

    public virtual string LastName { get; set; }

    [NotMapped]
    public string FullName { get { return FirstName + " " + LastName; } }
  }

}
于 2012-12-16T20:09:27.700 回答