コード例 #1
0
        static async Task Main(string[] args)
        {
            SaveToStorage saveToStorage;

            var storageModel = new StorageModel <Invoice>()
            {
                Id = Guid.NewGuid().ToString()
            };

            saveToStorage = new SaveToMSSQL();
            await saveToStorage.Execute(storageModel);

            saveToStorage = new SaveToBlobStorage();
            await saveToStorage.Execute(storageModel);

            /* Preconditions */
            new Preconditions().Run();
            /* Preconditions */

            /* Postconditions */
            new Postconditions().Run();
            /* Postconditions */

            /* Exceptions */
            new Exceptions().Run();
            /* Exceptions */

            Console.ReadKey();
        }
コード例 #2
0
 public virtual async Task Execute <T>(StorageModel <T> model)
 {
     if (string.IsNullOrWhiteSpace(model.Id))
     {
         throw new ArgumentException("Id cannot be null or whitespace.");
     }
 }
コード例 #3
0
        public override async Task Execute <T>(StorageModel <T> model)
        {
            await base.Execute <T>(model);

            //save to BlobStorage
        }