示例#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));
        }