public async Task <ActionResult <İcraSonuç> > Put(Restoran restoran) { try { var sonuç = await RestoranlarVeriYardımcı.RestoranDeğiştir(restoran); if (sonuç.BaşarılıMı) { BisiparişSistemVeriYardımcı.İşlemKaydet(new Sistemİşlem() { KullanıcıId = restoran.OluşturuKimsiId, Tip = İşlemTip.RestoranDeğiştirdi, ÖğeId = restoran.Id }); } return(sonuç); //if (sonuç.BaşarılıMı) // return Ok(); //else // return BadRequest(sonuç.Mesaj); } catch (Exception ex) { throw ex; } }
public async Task <ActionResult <İcraSonuç> > Post(Restoran yeniRestoran) { try { //await BisiparişVeriYardımcı.GünlükKaydetme(OlaySeviye.Uyarı, "DB Saving new restaurant..."); var sonuç = await RestoranlarVeriYardımcı.YeniRestoranEkle(yeniRestoran); if (sonuç.BaşarılıMı) { BisiparişSistemVeriYardımcı.İşlemKaydet(new Sistemİşlem() { KullanıcıId = yeniRestoran.OluşturuKimsiId, Tip = İşlemTip.YeniRestoranEkledi, ÖğeId = yeniRestoran.Id }); } //await BisiparişVeriYardımcı.GünlükKaydetme(OlaySeviye.Uyarı, sonuç != null ? "Result is there" : "(NULL result)"); return(sonuç); //if (sonuç.BaşarılıMı) // return Ok(sonuç);//CreatedAtAction(nameof(Post), new { id = yeniRestoran.Id }, yeniRestoran); //else // return BadRequest(sonuç); } catch (Exception ex) { await BisiparişVeriYardımcı.GünlükKaydet(OlaySeviye.Uyarı, ex); throw ex; } }