public bool UpdateMail(MailUpdateDataRequest req) { try { var mail = EmailAddressRepository.GetAll().Where(x => x.Email == req.Mail).FirstOrDefault(); mail.Email = req.NewMail; mail.AccountName = req.NewAccountName; mail.GroupId = req.NewGroupId; EmailAddressRepository.Update(mail); return(true); } catch (Exception) { return(false); } }
public IActionResult PutMail([FromBody] MailUpdateDataRequest req) { var result = MailAddressBL.UpdateMail(req); return(Ok(result)); }