Exemplo n.º 1
0
 protected internal DocumentPartition(CloudStorageAccount storageAccount, string tableName, string partitionKey, Func <T, string> rowKey, IDocumentSerializer serializer)
 {
     TableName    = tableName ?? DocumentPartition.GetDefaultTableName <T>();
     PartitionKey = partitionKey ?? TablePartition.GetDefaultPartitionKey <T>();
     repository   = new DocumentRepository <T>(storageAccount,
                                               TableName,
                                               _ => PartitionKey,
                                               rowKey ?? RowKeyAttribute.CreateCompiledAccessor <T>(),
                                               serializer);
 }
Exemplo n.º 2
0
        protected internal TablePartition(CloudStorageAccount storageAccount, string tableName, string partitionKey, Expression <Func <T, string> > rowKey)
        {
            TableName = tableName ?? TablePartition.GetDefaultTableName <T>();
            partitionKey ??= TablePartition.GetDefaultPartitionKey <T>();
            PartitionKey = partitionKey;

            repository = new TableRepository <T>(storageAccount,
                                                 TableName,
                                                 _ => partitionKey,
                                                 rowKey ?? RowKeyAttribute.CreateAccessor <T>());
        }