当前位置: 首页>>代码示例>>C#>>正文


C# IClassDef.IsUsingClassTableInheritance方法代码示例

本文整理汇总了C#中IClassDef.IsUsingClassTableInheritance方法的典型用法代码示例。如果您正苦于以下问题:C# IClassDef.IsUsingClassTableInheritance方法的具体用法?C# IClassDef.IsUsingClassTableInheritance怎么用?C# IClassDef.IsUsingClassTableInheritance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IClassDef的用法示例。


在下文中一共展示了IClassDef.IsUsingClassTableInheritance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrepareField

 ///<summary>
 /// Prepares 
 ///</summary>
 ///<param name="currentSource"></param>
 ///<param name="classDef"></param>
 ///<param name="field"></param>
 ///<returns></returns>
 public static IPropDef PrepareField(Source currentSource, IClassDef classDef, QueryField field)
 {
     IClassDef classDefOfField = classDef;
     if (classDef.IsUsingClassTableInheritance())
         classDefOfField = classDef.GetPropDef(field.PropertyName).ClassDef;
     IClassDef fieldClassDef;
     PrepareSource(classDefOfField, ref currentSource, out fieldClassDef);
     field.Source = currentSource;
     if (fieldClassDef != null)
         return fieldClassDef.GetPropDef(field.PropertyName);
     return null;
 }
开发者ID:Celtic691,项目名称:habanero,代码行数:19,代码来源:QueryBuilder.cs

示例2: GetPropsToInclude

        /// <summary>
        /// Builds a collection of properties to include in the insertion,
        /// depending on the inheritance type.
        /// </summary>
        protected override IBOPropCol GetPropsToInclude(IClassDef currentClassDef)
        {
            var propsToInclude = base.GetPropsToInclude(currentClassDef);
            if (currentClassDef.IsUsingClassTableInheritance())
            {
                AddParentID(propsToInclude);
            }

            return propsToInclude;
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:InsertStatementGenerator.cs

示例3: CreateOrderCriteria

        ///<summary>
        /// Based on the class definition and the orderByString an <see cref="OrderCriteria"/> object is created.
        /// The orderCriteria object is a set of order by fields including information on their 
        /// business object properties and their dataSource. 
        ///</summary>
        ///<param name="classDef">The class definition to use for building the order criteria</param>
        ///<param name="orderByString">The orderby string to use for creating the <see cref="OrderCriteria"/>.</param>
        ///<returns>the newly created <see cref="OrderCriteria"/> object.</returns>
        public static IOrderCriteria CreateOrderCriteria(IClassDef classDef, string orderByString)
        {
            if (classDef == null) throw new ArgumentNullException("classDef");
            IOrderCriteria orderCriteria = OrderCriteria.FromString(orderByString);
            try
            {
                //TODO Mark 20 Mar 2009: Souldn't the following code be stripped out into a PrepareOrderBy method that is called before loading? (Similar to PrepareCriteria)
                foreach (OrderCriteriaField field in orderCriteria.Fields)
                {
                    Source source = field.Source;
                    IClassDef relatedClassDef;
                    IClassDef classDefOfField = classDef;
                    if (classDef.IsUsingClassTableInheritance())
                        classDefOfField = classDef.GetPropDef(field.PropertyName).ClassDef;
                    PrepareSource(classDefOfField, ref source, out relatedClassDef);
                    field.Source = source;

                    IPropDef propDef = relatedClassDef.GetPropDef(field.PropertyName);
                    field.FieldName = propDef.DatabaseFieldName;
                    field.Source.ChildSourceLeaf.EntityName = relatedClassDef.GetTableName(propDef);
                }
                return orderCriteria;
            }
            catch (InvalidPropertyNameException)
            {
                throw new InvalidOrderCriteriaException("The orderByString '" + orderByString 
                        + "' is not valid for the classDef '" + classDef.ClassNameFull);
            }
        }
开发者ID:Celtic691,项目名称:habanero,代码行数:37,代码来源:QueryBuilder.cs


注:本文中的IClassDef.IsUsingClassTableInheritance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。