示例#1
0
 public TableClientValueProvider(
     ParameterInfo parameter,
     TableConfigContext configContext)
 {
     Parameter     = parameter;
     ConfigContext = configContext;
 }
示例#2
0
        public static string GetEntityId(
            this ApiHubTableAttribute attribute,
            TableConfigContext configContext)
        {
            var entityId = configContext.NameResolver.ResolveWholeString(attribute.EntityId);

            return(entityId);
        }
示例#3
0
        public TableClientBinding(
            ParameterInfo parameter,
            TableConfigContext configContext)
        {
            ValidateParameter(parameter);

            Parameter     = parameter;
            ConfigContext = configContext;
        }
示例#4
0
 public TableEntityValueBinder(
     ParameterInfo parameter,
     ApiHubTableAttribute resolvedAttribute,
     TableConfigContext configContext)
 {
     Parameter         = parameter;
     ResolvedAttribute = resolvedAttribute;
     ConfigContext     = configContext;
 }
示例#5
0
        public static ITableClient GetTableClient(
            this ApiHubTableAttribute attribute,
            TableConfigContext configContext)
        {
            var connection  = configContext.ConnectionFactory.CreateConnection(attribute.Connection);
            var tableClient = connection.CreateTableClient();

            return(tableClient);
        }
示例#6
0
        public static ITable <TEntity> GetTableReference <TEntity>(
            this ApiHubTableAttribute attribute,
            TableConfigContext configContext)
            where TEntity : class
        {
            var dataSet   = GetDataSetReference(attribute, configContext);
            var tableName = configContext.NameResolver.ResolveWholeString(attribute.TableName);
            var table     = dataSet.GetTableReference <TEntity>(tableName);

            return(table);
        }
示例#7
0
        public static IDataSet GetDataSetReference(
            this ApiHubTableAttribute attribute,
            TableConfigContext configContext)
        {
            var tableClient = GetTableClient(attribute, configContext);
            var dataSetName =
                string.IsNullOrEmpty(attribute.DataSetName)
                    ? null
                    : configContext.NameResolver.ResolveWholeString(attribute.DataSetName);
            var dataSet = tableClient.GetDataSetReference(dataSetName);

            return(dataSet);
        }
        public TableBinding(
            ParameterInfo parameter,
            TableConfigContext configContext)
        {
            ValidateParameter(parameter);

            Parameter     = parameter;
            ConfigContext = configContext;

            ApiHubTableAttribute attribute = Parameter.GetTableAttribute();

            if (!string.IsNullOrEmpty(attribute.DataSetName))
            {
                _dataSetNameBindingTemplate = BindingTemplate.FromString(attribute.DataSetName, ignoreCase: true);
            }

            if (!string.IsNullOrEmpty(attribute.TableName))
            {
                _tableNameBindingTemplate = BindingTemplate.FromString(attribute.TableName, ignoreCase: true);
            }
        }
 public TableBindingProvider(TableConfigContext configContext)
 {
     ConfigContext = configContext;
 }