Beispiel #1
0
        private void DomainDefinition(IObjectRelationalMapper orm)
        {
            orm.TablePerClassHierarchy(new[] { typeof(EntityBase <Guid>) });
            orm.TablePerClass(DomainTypes);

            orm.OneToOne <News, Poll>();
            orm.ManyToOne <Category, News>();

            orm.Cascade <Category, News>(Cascade.All);
            orm.Cascade <News, Poll>(Cascade.All);
            orm.Cascade <User, Poll>(Cascade.All);
        }
Beispiel #2
0
 public Repository(IObjectRelationalMapper <T> objectRelationalMapper)
 {
     this.objectRelationalMapper = objectRelationalMapper;
 }
        private void DomainDefinition(IObjectRelationalMapper orm)
        {
            orm.TablePerClassHierarchy(new[] { typeof(EntityBase<Guid>) });
            orm.TablePerClass(DomainTypes);

            orm.OneToOne<Game, Location>();

            orm.OneToOne<Game, Club>();

            orm.ManyToMany<Game, Person>();
            orm.ManyToMany<Person, Game>();
            orm.ManyToMany<Game, Position>();
            orm.ManyToMany<Position, Game>();
            orm.ManyToMany<Person, Position>();
            orm.ManyToMany<Position, Person>();

            //orm.Cascade<Category, News>(Cascade.All);
            //orm.Cascade<News, Poll>(Cascade.All);
            //orm.Cascade<User, Poll>(Cascade.All);
        }