Example #1
0
        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();
        }
Example #2
0
 public void Post([FromBody] AgricultureAction value)
 {
     _actionService.AddOrUpdateAction(value);
 }