public async Task Edit(Imam model, int id)
        {
            var imam = await this.FindById(id);

            imam.Name    = model.Name;
            imam.SlugUrl = model.Name.MakeUrlFriednly();
            await this.DB.SaveChangesAsync();
        }
예제 #2
0
        public async Task <ActionResult> Edit(int id, Imam model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            await this.imamRepository.Edit(model, id);

            return(RedirectToAction("Index"));
        }
예제 #3
0
        public async Task <ActionResult> Create(Imam model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            await this.imamRepository.Create(model);

            return(RedirectToAction("Index"));
        }
 public async Task Delete(Imam model)
 {
     this.DB.Imam.Remove(model);
     await this.DB.SaveChangesAsync();
 }
 public async Task Create(Imam model)
 {
     model.SlugUrl = model.Name.MakeUrlFriednly();
     this.DB.Imam.Add(model);
     await this.DB.SaveChangesAsync();
 }