public IActionResult SaveRestProtocol([FromBody] RestProtocol entity) { if (null == entity) { return(BadRequest()); } if (entity.Id.IsNullOrEmpty()) { entity.Id = LiveGuid.NewGuid(); } try { _emrManagerService.SaveRestProtocol(entity); return(Ok(entity)); } catch (Exception e) { var msg = $"Error saving {nameof(RestProtocol)}"; Log.Error(msg); Log.Error($"{e}"); return(StatusCode(500, msg)); } }
public void SaveRestProtocol(RestProtocol protocol) { _restProtocolRepository.CreateOrUpdate(protocol); _restProtocolRepository.SaveChanges(); }