public async Task <bool> Edit(EditEmailRequestModel model) { var email = await _repository.Filter <Email>(x => x.Id == model.Id).FirstOrDefaultAsync(); if (email == null) { throw new Exception("email not found"); } email.EmailText = model.Email; _repository.Update(email); await _repository.SaveChangesAsync(); return(true); }
public async Task <IActionResult> Edit([FromBody] EditEmailRequestModel model) { return(await MakeActionCallAsync(async() => await emailService.Edit(model))); }