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


C# ObjectReference.GetOwner方法代码示例

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


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

示例1: InferJoinExpression

 private SimpleExpression InferJoinExpression(ObjectReference table)
 {
     if (table.GetOwner().IsNull()) return null;
     var table1 = _schema.FindTable(table.GetOwner().GetName());
     var table2 = _schema.FindTable(table.GetName());
     var foreignKey = GetForeignKey(table1, table2);
     return MakeJoinExpression(table, foreignKey);
 }
开发者ID:JorgeGamba,项目名称:Simple.Data,代码行数:8,代码来源:Joiner.cs

示例2: GetColumn

 private Column GetColumn(ObjectReference reference)
 {
     if (ReferenceEquals(reference, null))
     {
         return null;
     }
     var table = _schema.FindTable(reference.GetOwner().ToString());
     return table.FindColumn(reference.GetName());
 }
开发者ID:reverentgeek,项目名称:Simple.Data,代码行数:9,代码来源:ExpressionFormatter.cs

示例3: ResolveSubs

        private IEnumerable<object> ResolveSubs(IDictionary<string, object> dict, ObjectReference objectReference, string key)
        {
            if (objectReference.IsNull()) return Enumerable.Empty<object>();

            if (dict.ContainsKey(objectReference.GetName()))
            {
                var master = dict[objectReference.GetName()] as IDictionary<string,object>;
                if (master != null)
                {
                    if (master.ContainsKey(key))
                    {
                        return new[] {master[key]};
                    }
                }

                var detail = dict[objectReference.GetName()] as IEnumerable<IDictionary<string, object>>;
                if (detail != null)
                {
                    return detail.SelectMany(d => Resolve(d, objectReference, key));
                }
            }

            return ResolveSubs(dict, objectReference.GetOwner(), key);
        }
开发者ID:rposbo,项目名称:Simple.Data,代码行数:24,代码来源:WhereClauseHandler.cs

示例4: TryFormatAsObjectReference

        private string TryFormatAsObjectReference(ObjectReference objectReference, bool excludeAlias)
        {
            if (ReferenceEquals(objectReference, null)) return null;

            var table = _schema.FindTable(objectReference.GetOwner().GetAllObjectNamesDotted());
            var tableName = string.IsNullOrWhiteSpace(objectReference.GetOwner().GetAlias())
                                ? table.QualifiedName
                                : _schema.QuoteObjectName(objectReference.GetOwner().GetAlias());
            var column = table.FindColumn(objectReference.GetName());
            if (excludeAlias || objectReference.GetAlias() == null)
            {
                return string.Format("{0}.{1}", tableName, column.QuotedName);
            }

            return string.Format("{0}.{1} AS {2}", tableName, column.QuotedName,
                                 _schema.QuoteObjectName(objectReference.GetAlias()));
        }
开发者ID:kotsaris,项目名称:Simple.Data,代码行数:17,代码来源:SimpleReferenceFormatter.cs

示例5: GetOwnerTable

        private Table GetOwnerTable(ObjectReference objectReference, out string associationPath)
        {
            associationPath = string.Empty;

            var owner = objectReference.GetOwner();
            if (ReferenceEquals(owner, null))
                return null;

            if (ReferenceEquals(owner.GetOwner(), null))
                return _findTable(owner.GetName());

            var table = GetOwnerTable(owner, out associationPath);
            var association = table.FindAssociation(owner.GetName());
            associationPath = FormatObjectPath(associationPath, association.ActualName);
            return _findTable(association.ReferenceTableName);
        }
开发者ID:Jalalhejazi,项目名称:Simple.OData,代码行数:16,代码来源:SimpleReferenceFormatter.cs

示例6: AddWithAlias

 private ObjectReference AddWithAlias(ObjectReference c, RelationType relationType = RelationType.None)
 {
     if (relationType == RelationType.None)
         relationType = _schema.GetRelationType(c.GetOwner().GetOwner().GetName(), c.GetOwner().GetName());
     if (relationType == RelationType.None) throw new InvalidOperationException("No Join found");
     return c.As(string.Format("__with{0}__{1}__{2}",
                        relationType == RelationType.OneToMany
                            ? "n"
                            : "1", c.GetOwner().GetAliasOrName(), c.GetName()));
 }
开发者ID:hlach,项目名称:Simple.Data,代码行数:10,代码来源:QueryBuilder.cs

示例7: ObjectReferenceIsInJoinClause

 private static bool ObjectReferenceIsInJoinClause(JoinClause clause, ObjectReference reference)
 {
     return reference.GetOwner().GetAliasOrName().Equals(clause.Table.GetAliasOrName());
 }
开发者ID:visionwang,项目名称:Simple.Data,代码行数:4,代码来源:QueryBuilder.cs

示例8: GetFullName

        internal static string GetFullName(ObjectReference reference)
        {
            var names = new Stack<string>();
            string name;
            while (!ReferenceEquals(reference.GetOwner(), null))
            {
                name = reference.GetName();
                name = name == "Id" || name == "id" ? "_id" : name;
                names.Push(name);

                reference = reference.GetOwner();
            }

            return string.Join(".", names.ToArray());
        }
开发者ID:kppullin,项目名称:Simple.Data.MongoDB,代码行数:15,代码来源:ExpressionFormatter.cs

示例9: TryFormatAsObjectReference

        private string TryFormatAsObjectReference(ObjectReference objectReference)
        {
            if (ReferenceEquals(objectReference, null)) return null;

            var table = _schema.FindTable(objectReference.GetOwner().GetName());
            var column = table.FindColumn(objectReference.GetName());
            if (objectReference.Alias == null)
                return string.Format("{0}.{1}", table.QualifiedName, column.QuotedName);
            else
                return string.Format("{0}.{1} AS {2}", table.QualifiedName, column.QuotedName,
                                     _schema.QuoteObjectName(objectReference.Alias));
        }
开发者ID:vansha,项目名称:Simple.Data,代码行数:12,代码来源:QueryBuilder.cs

示例10: IsTableChain

 private bool IsTableChain(string tableName, ObjectReference o)
 {
     var ownerName = tableName.Contains(".") ? o.GetOwner().GetAllObjectNamesDotted() : o.GetOwner().GetName();
     return (!ownerName.Equals(tableName, StringComparison.InvariantCultureIgnoreCase)) && _schema.IsTable(ownerName);
 }
开发者ID:JorgeGamba,项目名称:Simple.Data,代码行数:5,代码来源:UpdateHelper.cs


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