OneToManyPart <TChild> HasMany <TChild>(Member member) { //PROTOTYPE1: ADDED var part = providers.Collections.OfType <OneToManyPart <TChild> >().FirstOrDefault(p => p.Property.Name == member.Name); if (part == null) { //PROTOTYPE1: ADDED OnMemberMapped(member); part = new OneToManyPart <TChild>(EntityType, member); //PROTOTYPE1: ADDED if (this.UseBackingField(member.Name)) { part.Access.CamelCaseField(Prefix.Underscore); } //PROTOTYPE1: ADDED providers.Collections.Add(part); //PROTOTYPE1: ADDED } //PROTOTYPE1: ADDED return(part); }
private OneToManyPart <TChild> HasMany <TChild>(Member member) { this.OnMemberMapped(member); OneToManyPart <TChild> oneToManyPart = new OneToManyPart <TChild>(this.EntityType, member); this.providers.Collections.Add((ICollectionMappingProvider)oneToManyPart); return(oneToManyPart); }
protected virtual OneToManyPart <TChild> HasMany <TChild>(Member member) { var part = new OneToManyPart <TChild>(EntityType, member); collections.Add(part); return(part); }
OneToManyPart <TChild> HasMany <TChild>(Member member) { OnMemberMapped(member); var part = new OneToManyPart <TChild>(EntityType, member); providers.Collections.Add(part); return(part); }
/// <summary> /// 一对多配置,适用新框架(不级联更新) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="part"></param> /// <param name="keyColumn">字段</param> /// <param name="orderBy">排序表达式 : createtime desc,可空</param> /// <returns></returns> public static OneToManyPart <T> Config <T>(this OneToManyPart <T> part, string keyColumn, string orderBy = "") { var p = part .KeyColumn(keyColumn) .LazyLoad() .Fetch.Select() .Inverse() .Cascade.None(); if (!String.IsNullOrEmpty(orderBy)) { p = p.OrderBy(orderBy); } return(p); }