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


C# ObjectReference.GetName方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: TryFormatAsObjectReference

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

            if (_findTable == null)
            {
                return objectReference.GetName();
            }
            else
            {
                string associationPath;
                Table table = GetOwnerTable(objectReference, out associationPath);
                return FormatObjectPath(associationPath, table.FindColumn(objectReference.GetName()).ActualName);
            }
        }
开发者ID:Jalalhejazi,项目名称:Simple.OData,代码行数:15,代码来源:SimpleReferenceFormatter.cs

示例5: IsCoreTable

 private bool IsCoreTable(ObjectReference tableReference)
 {
     if (ReferenceEquals(tableReference, null)) throw new ArgumentNullException("tableReference");
     if (!string.IsNullOrWhiteSpace(tableReference.GetAlias())) return false;
     return _schema.FindTable(tableReference.GetName()) == _table;
 }
开发者ID:hlach,项目名称:Simple.Data,代码行数:6,代码来源:QueryBuilder.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: CreateJoinExpression

        private SimpleExpression CreateJoinExpression(ObjectReference table, ForeignKey foreignKey, int columnIndex)
        {
            var masterObjectReference = ObjectReference.FromStrings(foreignKey.MasterTable.Name,
                                                                    foreignKey.UniqueColumns[columnIndex]);
            var detailObjectReference = ObjectReference.FromStrings(foreignKey.DetailTable.Name,
                                                                    foreignKey.Columns[columnIndex]);

            if (!string.IsNullOrWhiteSpace(table.GetAlias()))
            {
                if (detailObjectReference.GetOwner().GetName() == table.GetName())
                    detailObjectReference = new ObjectReference(detailObjectReference.GetName(), table);
                else if (masterObjectReference.GetOwner().GetName() == table.GetName())
                    masterObjectReference = new ObjectReference(masterObjectReference.GetName(), table);
            }

            return masterObjectReference == detailObjectReference;
        }
开发者ID:JorgeGamba,项目名称:Simple.Data,代码行数:17,代码来源:Joiner.cs

示例8: 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

示例9: SetMemberAsSchema

 internal DynamicSchema SetMemberAsSchema(ObjectReference reference, DynamicSchema schema)
 {
     if (reference == null) throw new ArgumentNullException("reference");
     _members.TryUpdate(reference.GetName(), schema, reference);
     return (DynamicSchema) _members[reference.GetName()];
 }
开发者ID:remcok,项目名称:Simple.Data,代码行数:6,代码来源:DataStrategy.cs

示例10: SetMemberAsTable

 internal DynamicTable SetMemberAsTable(ObjectReference reference, DynamicTable table)
 {
     if (reference == null) throw new ArgumentNullException("reference");
     _members.TryUpdate(reference.GetName(), table, reference);
     return (DynamicTable) _members[reference.GetName()];
 }
开发者ID:remcok,项目名称:Simple.Data,代码行数:6,代码来源:DataStrategy.cs

示例11: 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

示例12: 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

示例13: SetMemberAsSchema

 internal DynamicSchema SetMemberAsSchema(ObjectReference reference)
 {
     if (ReferenceEquals(reference, null)) throw new ArgumentNullException("reference");
     _members.TryUpdate(reference.GetName(), new DynamicSchema(reference.GetName(), this), reference);
     return (DynamicSchema) _members[reference.GetName()];
 }
开发者ID:JorgeGamba,项目名称:Simple.Data,代码行数:6,代码来源:DataStrategy.cs

示例14: TryFormatAsObjectReference

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

            return objectReference.GetName();
        }
开发者ID:yvesgoeleven,项目名称:Simple.Data.Azure,代码行数:6,代码来源:ExpressionFormatter.cs

示例15: BuildReferenceResolver

        private static Func<XElement, object> BuildReferenceResolver(ObjectReference reference)
        {
            var resolver = BuildElementResolver(reference);

            return xml => resolver(xml).TryGetAttribute(reference.GetName()).ConvertValue();
        }
开发者ID:JorgeGamba,项目名称:Simple.Data,代码行数:6,代码来源:XmlPredicateBuilder.cs


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