Esempio n. 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();
        }
 public virtual async Task Execute <T>(StorageModel <T> model)
 {
     if (string.IsNullOrWhiteSpace(model.Id))
     {
         throw new ArgumentException("Id cannot be null or whitespace.");
     }
 }
        public override async Task Execute <T>(StorageModel <T> model)
        {
            await base.Execute <T>(model);

            //save to BlobStorage
        }