public IActionResult AddNewFarm([FromBody] Farm farm) { //var list = _context.Farms.Include(f => f.User).ToList(); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var newFarm = farmService.AddFarm(farm); return(Ok(newFarm)); }
public void Post([FromBody] FarmEntity farm) { _farmService.AddFarm(farm); }