public DataTable GetAll() { try { BlogPostDAL blogPostDAL = new BlogPostDAL(); return(blogPostDAL.GetAll()); } catch (Exception) { throw; } }
public DataTable GetById(int id) { try { BlogPostDAL blogPostDAL = new BlogPostDAL(); return(blogPostDAL.GetById(id)); } catch (Exception) { throw; } }
public bool Delete(BlogPosts blogPost) { try { BlogPostDAL blogPostDAL = new BlogPostDAL(); return(blogPostDAL.Delete(blogPost)); } catch (Exception) { throw; } }
public bool Save(BlogPosts blogPost) { try { BlogPostDAL blogPostDAL = new BlogPostDAL(); if (IsTitleExist(blogPost)) { throw new Exception("Title already exist."); } else { return(blogPostDAL.Save(blogPost)); } } catch (Exception) { throw; } }