public void CloseDiscussion(string tenantId, string discussionId) { var discussion = _discussionRepository.Get(new Tenant(tenantId), new DiscussionId(discussionId)); discussion.Close(); _discussionRepository.Save(discussion); }
public void StartExclusiveForumWithDiscussion( string tenantId, string exclusiveOwner, string creatorId, string moderatorId, string authorId, string forumSubject, string forumDescription, string discussionSubject, IForumCommandResult result = null) { var tenant = new Tenant(tenantId); Forum forum = null; var forumId = _forumQueryService.GetForumIdByExclusiveOwner(tenantId, exclusiveOwner); if (forumId != null) { forum = _forumRepository.Get(tenant, new ForumId(forumId)); } if (forum == null) { forum = StartNewForum(tenant, creatorId, moderatorId, forumSubject, forumDescription, exclusiveOwner); } Discussion discussion = null; var discussionId = _discussionQueryService.GetDiscussionIdByExclusiveOwner(tenantId, exclusiveOwner); if (discussionId != null) { discussion = _discussionRepository.Get(tenant, new DiscussionId(discussionId)); } if (discussion == null) { var author = _collaboratorService.GetAuthorFrom(tenant, authorId); discussion = forum.StartDiscussionFor(_forumIdentityService, author, discussionSubject, exclusiveOwner); _discussionRepository.Save(discussion); } if (result != null) { result.SetResultingForumId(forum.ForumId.Id); result.SetResultingDiscussionId(discussion.DiscussionId.Id); } }
public Discussion Get(Guid reportGuid, DiscussionTargetType targetType, Guid targetGuid) { return(_dicussionRepository.Get(reportGuid, targetType, targetGuid)); }