public async Task <IActionResult> AddContact([FromForm] ContactUsDTO request) { try { if (String.IsNullOrEmpty(request.NameEn)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "English Name Not Found!")); } else if (String.IsNullOrEmpty(request.NameAr)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Arabic Name Not Found!")); } else if (request.Latitude <= 0) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Latitude Not Found!")); } else if (request.Longitude <= 0) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Latitude Not Found!")); } else if (String.IsNullOrEmpty(request.Telephone)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Telephone Not Found!")); } else if (String.IsNullOrEmpty(request.Fax)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Fax Not Found!")); } else if (String.IsNullOrEmpty(request.TollFree)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "TollFree Not Found!")); } else if (String.IsNullOrEmpty(request.Mobile)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Mobile Not Found!")); } else if (String.IsNullOrEmpty(request.Email)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "Email Not Found!")); } else if (String.IsNullOrEmpty(request.PoBox)) { return(StatusCode((int)System.Net.HttpStatusCode.BadRequest, "PoBox Not Found!")); } else { var result = await _contactRepo.AddAsync(request); if (result != null) { return(Ok(result)); } else { return(NoContent()); } } } catch (Exception ex) { return(StatusCode((int)System.Net.HttpStatusCode.InternalServerError, ex.Message)); } }