public async Task <ActionResult> Post([FromBody] Notification notification) { try { if (!(await _dBContext.AddNotificationAsync(notification))) { throw new Exception("Failed to create price alert!!!"); } if (!(await _emailService.SendConfirmationEmailAsync(notification))) { throw new Exception("Price alert created successfully, but we failed to send you a confirmation email!!!"); } ; return(Ok(new { status = true, message = "Price alert created successfully. A confirmation email has been sent!!!" })); } catch (Exception ex) { return(Ok(new { status = false, message = ex.Message })); } }