public int CreateOrUpdate(AlertBllModel alert) { if (alert != null) { var entry = _mapper.Map <AlertsEntity>(alert); _floraDbContext.Add(entry); return(_floraDbContext.SaveChanges()); } else { throw new KeyNotFoundException(); } }
public IActionResult CreateOrUpdate([FromBody] AlertBllModel alert) { var res = _alertRepository.CreateOrUpdate(alert); return(Ok(res)); }