C# Class JustBlog.Core.BlogRepository

Inheritance: IBlogRepository
Show file Open project: VJAI/JustBlog Class Usage Examples

Public Methods

Method Description
AddCategory ( JustBlog.Core.Objects.Category category ) : int

Adds a new category.

AddPost ( JustBlog.Core.Objects.Post post ) : int

Adds a new post and returns the id.

AddTag ( JustBlog.Core.Objects.Tag tag ) : int

Add a new tag.

BlogRepository ( ISession session ) : System
Categories ( ) : IList

Return all the categories.

Category ( int id ) : JustBlog.Core.Objects.Category

Return category based on id.

Category ( string categorySlug ) : JustBlog.Core.Objects.Category

Return category based on url slug.

DeleteCategory ( int id ) : void

Delete a category permanently.

DeletePost ( int id ) : void

Delete the post permanently from database.

DeleteTag ( int id ) : void

Delete an existing tag permanently.

EditCategory ( JustBlog.Core.Objects.Category category ) : void

Update an existing category.

EditPost ( JustBlog.Core.Objects.Post post ) : void

Update an existing post.

EditTag ( JustBlog.Core.Objects.Tag tag ) : void

Edit an existing tag.

Post ( int id ) : JustBlog.Core.Objects.Post

Return post based on unique id.

Post ( int year, int month, string titleSlug ) : JustBlog.Core.Objects.Post

Return post based on the published year, month and title slug.

Posts ( int pageNo, int pageSize ) : IList

Return collection of posts based on pagination parameters.

Posts ( int pageNo, int pageSize, string sortColumn, bool sortByAscending ) : IList

Return posts based on pagination and sorting parameters.

PostsForCategory ( string categorySlug, int pageNo, int pageSize ) : IList

Return collection of posts belongs to a particular category.

PostsForSearch ( string search, int pageNo, int pageSize ) : IList

Return collection of posts that matches the search text.

PostsForTag ( string tagSlug, int pageNo, int pageSize ) : IList

Return collection of posts belongs to a particular tag.

Tag ( int id ) : JustBlog.Core.Objects.Tag

Return tag based on unique id.

Tag ( string tagSlug ) : JustBlog.Core.Objects.Tag

Return tag based on url slug.

Tags ( ) : IList

Return all the tags.

TotalCategories ( ) : int

Return total no. of categories.

TotalPosts ( bool checkIsPublished = true ) : int

Return total no. of all or published posts.

TotalPostsForCategory ( string categorySlug ) : int

Return total no. of posts belongs to a particular category.

TotalPostsForSearch ( string search ) : int

Return total no. of posts that matches the search text.

TotalPostsForTag ( string tagSlug ) : int

Return total no. of posts belongs to a particular tag.

TotalTags ( ) : int

Return total no. of tags.

Method Details

AddCategory() public method

Adds a new category.
public AddCategory ( JustBlog.Core.Objects.Category category ) : int
category JustBlog.Core.Objects.Category
return int

AddPost() public method

Adds a new post and returns the id.
public AddPost ( JustBlog.Core.Objects.Post post ) : int
post JustBlog.Core.Objects.Post
return int

AddTag() public method

Add a new tag.
public AddTag ( JustBlog.Core.Objects.Tag tag ) : int
tag JustBlog.Core.Objects.Tag
return int

BlogRepository() public method

public BlogRepository ( ISession session ) : System
session ISession
return System

Categories() public method

Return all the categories.
public Categories ( ) : IList
return IList

Category() public method

Return category based on id.
public Category ( int id ) : JustBlog.Core.Objects.Category
id int Category id
return JustBlog.Core.Objects.Category

Category() public method

Return category based on url slug.
public Category ( string categorySlug ) : JustBlog.Core.Objects.Category
categorySlug string Category's url slug
return JustBlog.Core.Objects.Category

DeleteCategory() public method

Delete a category permanently.
public DeleteCategory ( int id ) : void
id int
return void

DeletePost() public method

Delete the post permanently from database.
public DeletePost ( int id ) : void
id int
return void

DeleteTag() public method

Delete an existing tag permanently.
public DeleteTag ( int id ) : void
id int
return void

EditCategory() public method

Update an existing category.
public EditCategory ( JustBlog.Core.Objects.Category category ) : void
category JustBlog.Core.Objects.Category
return void

EditPost() public method

Update an existing post.
public EditPost ( JustBlog.Core.Objects.Post post ) : void
post JustBlog.Core.Objects.Post
return void

EditTag() public method

Edit an existing tag.
public EditTag ( JustBlog.Core.Objects.Tag tag ) : void
tag JustBlog.Core.Objects.Tag
return void

Post() public method

Return post based on unique id.
public Post ( int id ) : JustBlog.Core.Objects.Post
id int Post unique id
return JustBlog.Core.Objects.Post

Post() public method

Return post based on the published year, month and title slug.
public Post ( int year, int month, string titleSlug ) : JustBlog.Core.Objects.Post
year int Published year
month int Published month
titleSlug string Post's url slug
return JustBlog.Core.Objects.Post

Posts() public method

Return collection of posts based on pagination parameters.
public Posts ( int pageNo, int pageSize ) : IList
pageNo int Page index
pageSize int Page size
return IList

Posts() public method

Return posts based on pagination and sorting parameters.
public Posts ( int pageNo, int pageSize, string sortColumn, bool sortByAscending ) : IList
pageNo int Page index
pageSize int Page size
sortColumn string Sort column name
sortByAscending bool True to sort by ascending
return IList

PostsForCategory() public method

Return collection of posts belongs to a particular category.
public PostsForCategory ( string categorySlug, int pageNo, int pageSize ) : IList
categorySlug string Category's url slug
pageNo int Page index
pageSize int Page size
return IList

PostsForSearch() public method

Return collection of posts that matches the search text.
public PostsForSearch ( string search, int pageNo, int pageSize ) : IList
search string search text
pageNo int Page index
pageSize int Page size
return IList

PostsForTag() public method

Return collection of posts belongs to a particular tag.
public PostsForTag ( string tagSlug, int pageNo, int pageSize ) : IList
tagSlug string Tag's url slug
pageNo int Page index
pageSize int Page size
return IList

Tag() public method

Return tag based on unique id.
public Tag ( int id ) : JustBlog.Core.Objects.Tag
id int
return JustBlog.Core.Objects.Tag

Tag() public method

Return tag based on url slug.
public Tag ( string tagSlug ) : JustBlog.Core.Objects.Tag
tagSlug string
return JustBlog.Core.Objects.Tag

Tags() public method

Return all the tags.
public Tags ( ) : IList
return IList

TotalCategories() public method

Return total no. of categories.
public TotalCategories ( ) : int
return int

TotalPosts() public method

Return total no. of all or published posts.
public TotalPosts ( bool checkIsPublished = true ) : int
checkIsPublished bool True to count only published posts
return int

TotalPostsForCategory() public method

Return total no. of posts belongs to a particular category.
public TotalPostsForCategory ( string categorySlug ) : int
categorySlug string Category's url slug
return int

TotalPostsForSearch() public method

Return total no. of posts that matches the search text.
public TotalPostsForSearch ( string search ) : int
search string search text
return int

TotalPostsForTag() public method

Return total no. of posts belongs to a particular tag.
public TotalPostsForTag ( string tagSlug ) : int
tagSlug string Tag's url slug
return int

TotalTags() public method

Return total no. of tags.
public TotalTags ( ) : int
return int