public void AddOrUpdateAction(AgricultureAction action) { var entity = _actionRepository.GetByID(action.Id); if (entity != null) { _actionRepository.Detach(entity); _actionRepository.Update(action); } else { _actionRepository.Insert(action); } _actionRepository.Save(); }
public void Post([FromBody] AgricultureAction value) { _actionService.AddOrUpdateAction(value); }