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));
        }
Esempio n. 2
0
 public void Post([FromBody] FarmEntity farm)
 {
     _farmService.AddFarm(farm);
 }