public bool Post(Load load) { if (!ModelState.IsValid) { throw new HttpException((int)HttpStatusCode.BadRequest, "Invalid Request"); } if (loadService != null) { try { var loadToSave = load.CreateFromClientToServer(); if (loadService.SaveLoad(loadToSave)) { return(true); } } catch (Exception) { return(false); } } return(false); }
public IActionResult Post([FromBody] Load load) { _service.SaveLoad(load); return(Ok(load)); }