public async Task <ActionResult <List <AddNewQuoteCRUDResponse> > > AddAutoGeneratedQuote(int NumberOfQuotes) { List <AddNewQuoteCRUDResponse> addNewQuoteCRUDResponses = new List <AddNewQuoteCRUDResponse>(); IStandardCRUD standardCRUD = new QuoteModelCRUD(); QuoteCubeForPOSTCreate quoteCubeForPOST = new QuoteCubeForPOSTCreate(); IGenerateRandomQuote generateRandomQuote = new GenerateRandomQuoteSimple(); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); for (int i = 0; i < NumberOfQuotes; i++) { var autogeneratedRandomQuote = generateRandomQuote.GenerateQuoteCubeRandom(); quoteCubeForPOST.QuoteAuthor = autogeneratedRandomQuote.QuoteAuthor; quoteCubeForPOST.QuoteContent = autogeneratedRandomQuote.QuoteContent; var crudResponse = (AddNewQuoteCRUDResponse)await standardCRUD.AddOneRow(quoteCubeForPOST, _context); addNewQuoteCRUDResponses.Add(crudResponse); } stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. _ = stopWatch.Elapsed; return(addNewQuoteCRUDResponses); }
public async Task <ActionResult <AddNewQuoteCRUDResponse> > AddQuoteModel(QuoteCubeForPOSTCreate quoteCubeForPOST) { IStandardCRUD standardCRUD = new QuoteModelCRUD(); var crudResponse = (AddNewQuoteCRUDResponse)await standardCRUD.AddOneRow(quoteCubeForPOST, _context); return(crudResponse); }