开发者

EF4 - Is it possible to add a property to an entity which won't be reflected in the db?

In the epic quest of me getting my Create and Edit methods working for my complex model, I've come up with an idea - adding a bool开发者_如何转开发ean IsSelected property to one of my entity classes for use with checkboxes in my views. Is it possible? Would something as simple as

public partial class Platform : SomeBaseClass
{
    public bool IsSelected { get; set; }
}

Do the trick?


Yes, it works. Have you tried it?

That said, I recommend dedicated view models.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜