public async Task <IActionResult> Update(Il entity) { try { if (await _il.GetById(entity.Id) != null) { await _log.Add(new Log() { DurumId = 1, IslemTipId = 5, Aciklama = entity.Ad + " İli Düzenlendi", KullaniciId = Convert.ToInt32(Request.Headers["current-user-id"]), KullaniciAdi = Request.Headers["current-user-name"], Tarih = DateTime.Now, IP = Request.Headers["ip-address"] }); return(Ok(_il.Update(entity))); } else { await _log.Add(new Log() { DurumId = 2, IslemTipId = 5, Aciklama = entity.Ad + " İli Düzenlenemedi", KullaniciId = Convert.ToInt32(Request.Headers["current-user-id"]), KullaniciAdi = Request.Headers["current-user-name"], Tarih = DateTime.Now, IP = Request.Headers["ip-address"] }); return(NotFound()); } } catch (System.Exception) { await _log.Add(new Log() { DurumId = 2, IslemTipId = 5, Aciklama = "İl Servisinde Düzenleme Hatası Oluştu!", KullaniciId = Convert.ToInt32(Request.Headers["current-user-id"]), KullaniciAdi = Request.Headers["current-user-name"], Tarih = DateTime.Now, IP = Request.Headers["ip-address"] }); return(NotFound()); } }
public void Update(Il entity) { _IilRepository.Update(entity); }