public ManyToOnePart(Type entity, Member property) { this.entity = entity; this.property = property; access = new AccessStrategyBuilder <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.Access, value)); fetch = new FetchTypeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.Fetch, value)); cascade = new CascadeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.Cascade, value)); notFound = new NotFoundExpression <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.NotFound, value)); }
protected ManyToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.childType = collectionType; this.fetch = new FetchTypeExpression <ManyToManyPart <TChild> >(this, (Action <string>)(value => this.collectionAttributes.Set("Fetch", 2, (object)value))); this.notFound = new NotFoundExpression <ManyToManyPart <TChild> >(this, (Action <string>)(value => this.relationshipAttributes.Set("NotFound", 2, (object)value))); this.childKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this); this.parentKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this); }
protected ManyToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.entity = entity; childType = collectionType; fetch = new FetchTypeExpression <ManyToManyPart <TChild> >(this, value => collectionAttributes.Set(x => x.Fetch, value)); notFound = new NotFoundExpression <ManyToManyPart <TChild> >(this, value => relationshipAttributes.Set(x => x.NotFound, value)); }
protected ManyToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { childType = collectionType; fetch = new FetchTypeExpression <ManyToManyPart <TChild> >(this, value => collectionAttributes.Set("Fetch", Layer.UserSupplied, value)); notFound = new NotFoundExpression <ManyToManyPart <TChild> >(this, value => relationshipAttributes.Set("NotFound", Layer.UserSupplied, value)); childKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this); parentKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this); }
public ManyToOnePart(Type entity, Member member) { this.entity = entity; this.member = member; access = new AccessStrategyBuilder <ManyToOnePart <TOther> >(this, value => attributes.Set("Access", Layer.UserSupplied, value)); fetch = new FetchTypeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("Fetch", Layer.UserSupplied, value)); cascade = new CascadeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("Cascade", Layer.UserSupplied, value)); notFound = new NotFoundExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("NotFound", Layer.UserSupplied, value)); SetDefaultAccess(); }
protected OneToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.entity = entity; childType = collectionType; keyColumns = new ColumnMappingCollection <OneToManyPart <TChild> >(this); notFound = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipAttributes.Set("NotFound", Layer.UserSupplied, value)); collectionAttributes.Set("Name", Layer.Defaults, member.Name); }
protected OneToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.entity = entity; childType = collectionType; keyColumns = new ColumnMappingCollection <OneToManyPart <TChild> >(this); cascade = new CollectionCascadeExpression <OneToManyPart <TChild> >(this, value => collectionAttributes.Set(x => x.Cascade, value)); notFound = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipAttributes.Set(x => x.NotFound, value)); collectionAttributes.SetDefault(x => x.Name, member.Name); }
public ManyToOnePart(Type entity, Member member) { this.entity = entity; this.member = member; access = new AccessStrategyBuilder <ManyToOnePart <TOther> >(this, value => attributes.Set("Access", Layer.UserSupplied, value)); fetch = new FetchTypeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("Fetch", Layer.UserSupplied, value)); cascade = new CascadeExpression <ManyToOnePart <TOther> >(this, value => { var current = attributes.Get("Cascade") as string; attributes.Set("Cascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value)); }); notFound = new NotFoundExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("NotFound", Layer.UserSupplied, value)); SetDefaultAccess(); }
protected OneToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.entity = entity; childType = collectionType; keyColumns = new ColumnMappingCollection <OneToManyPart <TChild> >(this); cascade = new CollectionCascadeExpression <OneToManyPart <TChild> >(this, value => { var current = collectionAttributes.Get("Cascade") as string; collectionAttributes.Set("Cascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value)); }); notFound = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipAttributes.Set("NotFound", Layer.UserSupplied, value)); collectionAttributes.Set("Name", Layer.Defaults, member.Name); }
protected OneToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.entity = entity; childType = collectionType; cascade = new CollectionCascadeExpression <OneToManyPart <TChild> >(this, value => collectionAttributes.Set(x => x.Cascade, value)); notFound = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipMapping.NotFound = value); collectionAttributes.SetDefault(x => x.Name, member.Name); relationshipMapping = new OneToManyMapping { ContainingEntityType = entity }; }
protected ManyToManyPart(Type entity, Member member, Type collectionType) : base(entity, member, collectionType) { this.entity = entity; childType = collectionType; fetch = new FetchTypeExpression <ManyToManyPart <TChild> >(this, value => collectionAttributes.Set(x => x.Fetch, value)); notFound = new NotFoundExpression <ManyToManyPart <TChild> >(this, value => relationshipMapping.NotFound = value); relationshipMapping = new ManyToManyMapping { ContainingEntityType = entity }; relationshipMapping.As <ManyToManyMapping>(x => x.AddDefaultColumn(new ColumnMapping { Name = typeof(TChild).Name + "_id" })); }
public KeyManyToOnePart(KeyManyToOneMapping mapping) { this.mapping = mapping; Access = new AccessStrategyBuilder <KeyManyToOnePart>(this, value => mapping.Set(x => x.Access, Layer.UserSupplied, value)); NotFound = new NotFoundExpression <KeyManyToOnePart>(this, value => mapping.Set(x => x.NotFound, Layer.UserSupplied, value)); }
public KeyManyToOnePart(KeyManyToOneMapping mapping) { this.mapping = mapping; Access = new AccessStrategyBuilder <KeyManyToOnePart>(this, value => mapping.Access = value); NotFound = new NotFoundExpression <KeyManyToOnePart>(this, value => mapping.NotFound = value); }