Exemplo n.º 1
0
 public bool TryGet(ObjectName name, out TObject obj)
 {
     return(byName.TryGetValue(name, out obj));
 }
Exemplo n.º 2
0
 public SelectColumn(Expression expression, ObjectName alias)
 {
     Alias      = alias;
     Expression = expression;
 }
Exemplo n.º 3
0
 public bool ContainsKey(ObjectName name)
 {
     return(byName.ContainsKey(name));
 }
Exemplo n.º 4
0
 public void Set(ObjectName name, TObject obj)
 {
     byName[name]  = obj;
     nameMap[name] = name;
     offsets.Clear();
 }
Exemplo n.º 5
0
 public static Task <ObjectName> ResolveTableNameAsync(this IContext context, ObjectName tableName)
 => context.ResolveObjectNameAsync(DbObjectType.Table, tableName);
Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 9
0
 public static async Task <ITable> GetTableAsync(this IContext context, ObjectName tableName)
 {
     return(await GetObjectAsync(context, DbObjectType.Table, tableName) as ITable);
 }