示例#1
0
        public async Task <IActionResult> Ekle([FromBody] PersonelDTO pDto)
        {
            Personel per = new Personel();

            per.Name    = pDto.name;
            per.Surname = pDto.surName;
            per.CityId  = pDto.cityId;
            _repPersonel.Add(per);
            await _repPersonel.Comit();

            return(Json(pDto));
        }
        public async Task <JsonResult> Guncel([FromBody] PersonelDTO pr)
        {
            Personel personel = new Personel();

            personel.PersonelId    = pr.personelId;
            personel.PersonelAd    = pr.personelAd;
            personel.PersonelSoyad = pr.personelSoyad;
            personel.SehirId       = pr.sehirId;

            _reppersonel.Save(personel);
            await _reppersonel.Comit();

            return(Json(pr));
        }