Example #1
0
        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;
     }
 }
Example #3
0
        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));
     }
 }
Example #5
0
        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
            });
        }
Example #6
0
 public Blog GetBlogById(int Id)
 {
     return(_blogDal.Get(x => x.Id == Id));
 }
Example #7
0
 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);
        }
Example #9
0
        public void Delete(int id)
        {
            var blog = _blogDal.Get(p => p.Id == id);

            _blogDal.Delete(blog);
        }
Example #10
0
 public Blog GetById(int blogId)
 {
     return(_blogDal.Get(x => x.BlogId == blogId));
 }
Example #11
0
        public IDataResult <Blog> GetById(int id)
        {
            var data = _blogDal.Get(b => b.Id == id);

            return(new SuccessDataResult <Blog>(data));
        }