Пример #1
0
 public bool TryGet(ObjectName name, out TObject obj)
 {
     return(byName.TryGetValue(name, out obj));
 }
Пример #2
0
 public SelectColumn(Expression expression, ObjectName alias)
 {
     Alias      = alias;
     Expression = expression;
 }
Пример #3
0
 public bool ContainsKey(ObjectName name)
 {
     return(byName.ContainsKey(name));
 }
Пример #4
0
 public void Set(ObjectName name, TObject obj)
 {
     byName[name]  = obj;
     nameMap[name] = name;
     offsets.Clear();
 }
Пример #5
0
 public static Task <ObjectName> ResolveTableNameAsync(this IContext context, ObjectName tableName)
 => context.ResolveObjectNameAsync(DbObjectType.Table, tableName);
Пример #6
0
        public static async Task <ObjectName> ResolveObjectNameAsync(this IContext context, DbObjectType objectType, ObjectName objectName)
        {
            var manager = context.GetObjectManager(objectType);

            if (manager == null)
            {
                return(objectName);
            }

            if (objectName.Parent == null)
            {
                var currentSchema = context.CurrentSchema();
                objectName = new ObjectName(new ObjectName(currentSchema), objectName.Name);
            }

            var resolved = await manager.ResolveNameAsync(objectName, context.IgnoreCase());

            if (resolved == null)
            {
                resolved = objectName;
            }

            return(resolved);
        }
Пример #7
0
        public static async Task <IDbObjectInfo> GetObjectInfoAsync(this IContext context, DbObjectType objectType, ObjectName objectName)
        {
            var manager = context.GetObjectManager(objectType);

            if (manager == null)
            {
                return(null);
            }

            return(await manager.GetObjectInfoAsync(objectName));
        }
Пример #8
0
        public static async Task <bool> ObjectExistsAsync(this IContext context, DbObjectType objectType, ObjectName objectName)
        {
            var manager = context.GetObjectManager(objectType);

            if (manager == null)
            {
                return(false);
            }

            return(await manager.ObjectExistsAsync(objectName));
        }
Пример #9
0
 public static async Task <ITable> GetTableAsync(this IContext context, ObjectName tableName)
 {
     return(await GetObjectAsync(context, DbObjectType.Table, tableName) as ITable);
 }