public HttpResponseMessage Post([FromBody] AddressEntity addressEntity) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Please provide all the required fields.")); } addressEntity.LastModDate = DateTime.Now; addressEntity.SysTimeStamp = System.Text.Encoding.UTF8.GetBytes(DateTime.Now.ToString(CultureInfo.InvariantCulture)); return(Request.CreateResponse(HttpStatusCode.OK, _addressServices.CreateAddress(addressEntity))); }