public async Task <ActionResult <IEnumerable <ResponseEmployee> > > GetEmployee(int id) { if (id == 0) { throw new ArgumentException($"{id} is not a valid id"); } var results = await northwindRepository.GetAsyncEmployee(id); string val = JsonConvert.SerializeObject(results); // await sendmail.SendMail(val, EnumEmailType.plaintext); return(Ok(results)); }