C# Class OurUmbraco.Forum.Services.TopicService

ファイルを表示 Open project: umbraco/OurUmbraco Class Usage Examples

Public Methods

Method Description
ChangeCategory ( OurUmbraco.Forum.Models.Topic topic, int newCategory ) : void
CurrentTopic ( System.Web.HttpContextBase context, ICacheProvider cache ) : OurUmbraco.Forum.Models.ReadOnlyTopic

Get the current forum topic based on the id in the context

So that we don't have to look this up multiple times in a single request, this will use the given ICacheProvider to cache it

Delete ( OurUmbraco.Forum.Models.Topic topic ) : void
GetAllTopicsCount ( int category = -1 ) : int

Returns a count of all topics

GetAuthorLatestTopics ( int memberId ) : IEnumerable

Returns a set of topics for a specific author

GetById ( int id ) : OurUmbraco.Forum.Models.Topic
GetLatestTopics ( long take = 50, long page = 1, bool ignoreSpam = true, int category = -1 ) : IEnumerable

Returns a paged set of topics with the author information - without the comments loaded

GetLatestTopicsFiltered ( long take = 50, long page = 1, bool ignoreSpam = true, int category = -1, bool unsolved = false, bool noreplies = false ) : IEnumerable
GetLatestTopicsForMember ( int memberId, bool ignoreSpam = true, int maxCount = 100 ) : IEnumerable

Returns an in-memory collection of topics that a given member has participated in

Lock ( OurUmbraco.Forum.Models.Topic topic ) : void
QueryAll ( bool ignoreSpam = true, int maxCount = 1000 ) : IEnumerable

Returns a READER of all topics to be iterated over

QueryById ( int id ) : OurUmbraco.Forum.Models.ReadOnlyTopic

Returns a single topic including it's comments and author information

Save ( OurUmbraco.Forum.Models.Topic topic ) : OurUmbraco.Forum.Models.Topic
SendNotifications ( OurUmbraco.Forum.Models.ReadOnlyTopic topic, string memberName, string url ) : void
TopicService ( Umbraco.Core.DatabaseContext dbContext ) : System

Method Details

ChangeCategory() public method

public ChangeCategory ( OurUmbraco.Forum.Models.Topic topic, int newCategory ) : void
topic OurUmbraco.Forum.Models.Topic
newCategory int
return void

CurrentTopic() public method

Get the current forum topic based on the id in the context
So that we don't have to look this up multiple times in a single request, this will use the given ICacheProvider to cache it
public CurrentTopic ( System.Web.HttpContextBase context, ICacheProvider cache ) : OurUmbraco.Forum.Models.ReadOnlyTopic
context System.Web.HttpContextBase
cache ICacheProvider
return OurUmbraco.Forum.Models.ReadOnlyTopic

Delete() public method

public Delete ( OurUmbraco.Forum.Models.Topic topic ) : void
topic OurUmbraco.Forum.Models.Topic
return void

GetAllTopicsCount() public method

Returns a count of all topics
public GetAllTopicsCount ( int category = -1 ) : int
category int
return int

GetAuthorLatestTopics() public method

Returns a set of topics for a specific author
public GetAuthorLatestTopics ( int memberId ) : IEnumerable
memberId int
return IEnumerable

GetById() public method

public GetById ( int id ) : OurUmbraco.Forum.Models.Topic
id int
return OurUmbraco.Forum.Models.Topic

GetLatestTopics() public method

Returns a paged set of topics with the author information - without the comments loaded
public GetLatestTopics ( long take = 50, long page = 1, bool ignoreSpam = true, int category = -1 ) : IEnumerable
take long
page long
ignoreSpam bool
category int
return IEnumerable

GetLatestTopicsFiltered() public method

public GetLatestTopicsFiltered ( long take = 50, long page = 1, bool ignoreSpam = true, int category = -1, bool unsolved = false, bool noreplies = false ) : IEnumerable
take long
page long
ignoreSpam bool
category int
unsolved bool
noreplies bool
return IEnumerable

GetLatestTopicsForMember() public method

Returns an in-memory collection of topics that a given member has participated in
public GetLatestTopicsForMember ( int memberId, bool ignoreSpam = true, int maxCount = 100 ) : IEnumerable
memberId int
ignoreSpam bool
maxCount int
return IEnumerable

Lock() public method

public Lock ( OurUmbraco.Forum.Models.Topic topic ) : void
topic OurUmbraco.Forum.Models.Topic
return void

QueryAll() public method

Returns a READER of all topics to be iterated over
public QueryAll ( bool ignoreSpam = true, int maxCount = 1000 ) : IEnumerable
ignoreSpam bool
maxCount int /// Default is 1000 ///
return IEnumerable

QueryById() public method

Returns a single topic including it's comments and author information
public QueryById ( int id ) : OurUmbraco.Forum.Models.ReadOnlyTopic
id int
return OurUmbraco.Forum.Models.ReadOnlyTopic

Save() public method

public Save ( OurUmbraco.Forum.Models.Topic topic ) : OurUmbraco.Forum.Models.Topic
topic OurUmbraco.Forum.Models.Topic
return OurUmbraco.Forum.Models.Topic

SendNotifications() public method

public SendNotifications ( OurUmbraco.Forum.Models.ReadOnlyTopic topic, string memberName, string url ) : void
topic OurUmbraco.Forum.Models.ReadOnlyTopic
memberName string
url string
return void

TopicService() public method

public TopicService ( Umbraco.Core.DatabaseContext dbContext ) : System
dbContext Umbraco.Core.DatabaseContext
return System