public void KullaniciKurumYetkiEkle(KullaniciKurumYetkiDto kurumyetki) { var ent = Context.KullaniciKurumYetkiler.FirstOrDefault(x => x.Id == kurumyetki.Id); if (ent == null) { ent = new KullaniciKurumYetki(); Context.KullaniciKurumYetkiler.Add(ent); } ent.Aktif = kurumyetki.Aktif; ent.KullaniciId = kurumyetki.KullaniciId; ent.KurumId = kurumyetki.KurumId; Context.SaveChanges(); }
public void KullaniciYetkiGuncelle(KullaniciKurumYetkiDto dto) { var ent = Context.KullaniciKurumYetkiler.FirstOrDefault(x => x.KullaniciId == dto.Id); if (ent == null) { ent = new KullaniciKurumYetki(); ent.KullaniciId = dto.KullaniciId; // ent.Id = Context.KullaniciKurumYetkiler.Max(x => x.Id) + 1; Context.KullaniciKurumYetkiler.Add(ent); } ent.KurumId = dto.KurumId; ent.Aktif = dto.Aktif; Context.SaveChanges(); }