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

            return(Ok(res));
        }