开发者

How to fluent-map this (using fluent nhibernate)?

开发者 https://www.devze.com 2022-12-10 05:37 出处:网络
I have two tables in my database \"Styles\" and \"BannedStyles\". They have a reference via the ItemNo. Now styles can be banned per store. So if style x is banned at store Y then its very possible th

I have two tables in my database "Styles" and "BannedStyles". They have a reference via the ItemNo. Now styles can be banned per store. So if style x is banned at store Y then its very possible th开发者_运维技巧at its not banned at store Z or vice verse. What is the best way now to map this to a single entity? Should I be mapping this to a single entity?

My Style entity looks like this:

public class Style
{
        public virtual int ItemNo { get; set;}
        public virtual string SKU { get; set; }
        public virtual string StyleName { get; set; }
        public virtual string Description { get; set; }
        public virtual Store Store { get; set; }
        public virtual bool IsEntireStyleBanned { get; set; }
}


http://github.com/jagregory/fluent-nhibernate/tree/master/src/Examples.FirstProject/ might help you.

Magesh

0

精彩评论

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