Beispiel #1
0
 //===============================================================
 internal static AzureOptions <T> CreateFrom <TValue>(AzureOptions <TValue> options)
 {
     return(new AzureOptions <T>
     {
         ContainerName = options.ContainerName,
         ContentType = options.ContentType,
     });
 }
Beispiel #2
0
 //===============================================================
 public AzureContainerInterface(CloudStorageAccount storageAccount, AzureOptions <T> options)
 {
     StorageAccount = storageAccount;
     Options        = options;
 }
Beispiel #3
0
 //===============================================================
 private ExplicitKeyAzureRepository <String, String> Strings(AzureOptions <String> options = null)
 {
     return(ExplicitKeyAzureRepository <String, String> .ForStorageEmulator(options));
 }
Beispiel #4
0
 //===============================================================
 private ExplicitKeyAzureRepository <TestClass> ExplicitKeyTestObjects(AzureOptions <TestClass> options = null)
 {
     return(ExplicitKeyAzureRepository <TestClass> .ForStorageEmulator(options));
 }
Beispiel #5
0
 //===============================================================
 private AzureRepository <TestClass> TestObjects(AzureOptions <TestClass> options = null)
 {
     return(AzureRepository <TestClass> .ForStorageEmulator(x => x.ID, options));
 }
Beispiel #6
0
 //===============================================================
 public static AzureRepository <T> ForStorageEmulator(Func <T, object> keySelector, AzureOptions <T> options = null)
 {
     return(ForStorageEmulator(x => new[] { keySelector(x) }, options));
 }
Beispiel #7
0
 //===============================================================
 public static AzureRepository <T> ForStorageEmulator(Func <T, object[]> keySelector, AzureOptions <T> options = null)
 {
     return(new AzureRepository <T>(keySelector, CloudStorageAccount.DevelopmentStorageAccount, options));
 }
Beispiel #8
0
        //===============================================================
        public static AzureRepository <T> FromNamedConnectionString(Func <T, object> keySelector, String connectionStringName, AzureOptions <T> options = null)
        {
            var connStr = AzureUtility.GetNamedConnectionString(connectionStringName);

            return(FromExplicitConnectionString(keySelector, connStr, options));
        }
Beispiel #9
0
 //===============================================================
 public static AzureRepository <T> FromExplicitConnectionString(Func <T, object> keySelector, String connectionString, AzureOptions <T> options = null)
 {
     return(new AzureRepository <T>(keySelector, connectionString, options));
 }
Beispiel #10
0
        //===============================================================
        public static ExplicitKeyAzureRepository <TValue> FromNamedConnectionString(String connectionStringName, AzureOptions <TValue> options = null)
        {
            var connStr = AzureUtility.GetNamedConnectionString(connectionStringName);

            return(FromExplicitConnectionString(connStr, options));
        }
Beispiel #11
0
 //===============================================================
 public static ExplicitKeyAzureRepository <TValue> FromExplicitConnectionString(String connectionString, AzureOptions <TValue> options = null)
 {
     return(new ExplicitKeyAzureRepository <TValue>(connectionString, options));
 }
Beispiel #12
0
 //===============================================================
 public static ExplicitKeyAzureRepository <TValue> ForStorageEmulator(AzureOptions <TValue> options = null)
 {
     return(new ExplicitKeyAzureRepository <TValue>(AzureUtility.EMULATOR_CONNECTION_STRING, options));
 }
Beispiel #13
0
 //===============================================================
 public ExplicitKeyAzureRepository(String connectionString, AzureOptions <TValue> options = null)
     : base(new AzureRepository <TValue>(x => new object[] { }, connectionString, options))
 {
 }
Beispiel #14
0
        //===============================================================
        internal AzureRepository(Func <T, object[]> keySelector, CloudStorageAccount storageAccount, AzureOptions <T> options = null)
            : base(keySelector)
        {
            Options = options ?? new AzureOptions <T>();
            Options.ContainerName = Options.ContainerName != null?AzureUtility.SanitizeContainerName(Options.ContainerName) : AzureUtility.GetSanitizedContainerName <T>();

            AzureContainerInterface = new AzureContainerInterface <T>(storageAccount, Options);
            PendingChanges          = new List <IOperation>();
        }
Beispiel #15
0
 //===============================================================
 public AzureRepository(Func <T, object[]> keySelector, String connectionString, AzureOptions <T> options = null)
     : this(keySelector, CloudStorageAccount.Parse(connectionString), options)
 {
     ConnectionString = connectionString;
 }
Beispiel #16
0
 //===============================================================
 public AzureRepository(Func <T, object> keySelector, String connectionString, AzureOptions <T> options = null)
     : this(x => new[] { keySelector(x) }, connectionString, options)
 {
 }