private async Task InternalExecute() { var countCalls = 100; var persons = new List <Person>(); for (var count = 0; count < countCalls; count++) { persons.Add(await ExecutePost()); } foreach (var person in persons.Take(countCalls / 2)) { await _gateway.Get(person.Id); } foreach (var person in persons.Take(countCalls / 3)) { await ExecutePut(person); } foreach (var person in persons) { await _gateway.Delete(person.Id); } }
public async Task <IActionResult> GetById(string id) { var person = await _personGateway.Get(id); return(person.Match( Some: p => Ok(p), None: (IActionResult)NotFound())); }
public Task <Option <Person> > Get(string id) => ExecuteFunction(() => _decoratee.Get(id), "mongo_person_get");