public IActionResult Update(int?id) { var blog = _blogDal.Get(x => x.Id == id); ViewBag.Categories = new SelectList(_categoryDal.GetList(), "Id", "Name"); return(View(blog)); }
public Blog Get(Expression <Func <Blog, bool> > filter, params string[] includeList) { try { return(blogDal.Get(filter, includeList)); } catch (Exception ex) { throw ex; } }
public UiBlog GetById(int blogId) { Blog blog = _blogDal.Get(a => a.id == blogId); return(new UiBlog { title = blog.title, description = blog.description, content = blog.content, category = _categoryDal.Get(c => c.id == blog.categoryid).name, author = _authorDal.Get(a => a.id == blog.authorId).name }); }
public EntityResult <Blog> Get(Expression <Func <Blog, bool> > filter, params string[] includeList) { try { Blog blog = _blogDal.Get(filter, includeList); if (blog != null) { return(new EntityResult <Blog>(blog, "Başarılı", ResultState.Success)); } return(new EntityResult <Blog>(null, "Hata oluştu", ResultState.Warning)); } catch (Exception ex) { return(new EntityResult <Blog>(null, "Database Hatası", ResultState.Error)); } }
public DataResponse Get(int id) { var blog = _blogDal.Get(i => i.ID == id); if (blog == null) { return new DataResponse { Mesaj = "Aradiginiz Blog Bulunamadi", Tamamlandi = false } } ; return(new DataResponse { Data = blog, Mesaj = "Blog Getirildi", Tamamlandi = true }); }
public Blog GetBlogById(int Id) { return(_blogDal.Get(x => x.Id == Id)); }
public Blog Get(int id) { return(_blogDal.Get(b => b.Id == id)); }
public void Delete(int id) { var value = _blogDal.Get(x => x.Id == id); _blogDal.Delete(value); }
public void Delete(int id) { var blog = _blogDal.Get(p => p.Id == id); _blogDal.Delete(blog); }
public Blog GetById(int blogId) { return(_blogDal.Get(x => x.BlogId == blogId)); }
public IDataResult <Blog> GetById(int id) { var data = _blogDal.Get(b => b.Id == id); return(new SuccessDataResult <Blog>(data)); }