Ejemplo n.º 1
0
 public ICollectionRelationConfig<T, TRelation> CreateManyToMany<T, TRelation>(ITableConfig<T> table, RelationAttribute attribute, PropertyInfo property)
 {
     var accessor = Factories.PropertyAccessor.Relation.Create<T, ICollection<TRelation>>(property, TypeConfig.Unknown);
     return new ManyToManyRelationConfig<T, TRelation>(
         table.Config,
         attribute.Flags.EnsureMultiplicity(RelationFlags.ManyToMany),
         attribute.Identifier,
         table,
         table.Config.Table<T, TRelation>(table.Flags),
         table.Config.Table<TRelation>(table.Flags),
         accessor
     );
 }
Ejemplo n.º 2
0
 public IRelationConfig<T, TRelation> CreateOneToOne<T, TRelation>(ITableConfig<T> table, RelationAttribute attribute, PropertyInfo property)
 {
     var accessor = Factories.PropertyAccessor.Relation.Create<T, TRelation>(property, TypeConfig.Unknown);
     return new RelationConfig<T, TRelation>(
         table.Config,
         attribute.Flags.EnsureMultiplicity(RelationFlags.OneToOne),
         attribute.Identifier,
         table,
         table.Config.Table<TRelation>(table.Flags),
         accessor
     );
 }