Example #1
0
        ManyToOnePart <TOther> References <TOther>(Member member, string columnName)
        {
            //PROTOTYPE1: ADDED
            var part = providers.References.OfType <ManyToOnePart <TOther> >().FirstOrDefault(m => m.Property.Name == member.Name);

            if (part == null)
            {
                //PROTOTYPE1: ADDED

                OnMemberMapped(member);

                part = new ManyToOnePart <TOther>(EntityType, member);

                //PROTOTYPE1: ADDED
                if (this.UseBackingField(member.Name))
                {
                    part.Access.CamelCaseField(Prefix.Underscore);
                }
                //PROTOTYPE1: ADDED

                if (columnName != null)
                {
                    part.Column(columnName);
                }

                providers.References.Add(part);

                //PROTOTYPE1: ADDED
            }
            //PROTOTYPE1: ADDED

            return(part);
        }
Example #2
0
        private ManyToOnePart <TOther> References <TOther>(Member member, string columnName)
        {
            this.OnMemberMapped(member);
            ManyToOnePart <TOther> manyToOnePart = new ManyToOnePart <TOther>(this.EntityType, member);

            if (columnName != null)
            {
                manyToOnePart.Column(columnName);
            }
            this.providers.References.Add((IManyToOneMappingProvider)manyToOnePart);
            return(manyToOnePart);
        }
        protected virtual ManyToOnePart <TOther> References <TOther>(Member property, string columnName)
        {
            var part = new ManyToOnePart <TOther>(typeof(T), property);

            if (columnName != null)
            {
                part.Column(columnName);
            }

            references.Add(part);

            return(part);
        }
Example #4
0
        protected virtual ManyToOnePart <TOther> References <TOther>(Member property, string columnName)
        {
            var part = new ManyToOnePart <TOther>(EntityType, property);

            if (columnName != null)
            {
                part.Column(columnName);
            }

            providers.References.Add(part);

            return(part);
        }
Example #5
0
        /// <summary>
        /// 多对一配置,适用新框架(不级联更新)
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="part"></param>
        /// <param name="column">字段</param>
        /// <returns></returns>
        public static ManyToOnePart <T> Config <T>(this ManyToOnePart <T> part, string column)
        {
            var p = part
                    .LazyLoad()
                    .Fetch.Select()
                    //不能加这个,否则LoadType会使用  InternalLoadNullable ,则不能延迟加载 HHB
                    //.NotFound.Ignore()
                    .Cascade.None()
                    .Not.Insert()
                    .Not.Update()
                    .Column(column);

            return(p);
        }
        ManyToOnePart <TOther> References <TOther>(Member member, string columnName)
        {
            OnMemberMapped(member);

            var part = new ManyToOnePart <TOther>(EntityType, member);

            if (columnName != null)
            {
                part.Column(columnName);
            }

            providers.References.Add(part);

            return(part);
        }