예제 #1
0
        public BllPost AddNewPost(string postContent, BllMembershipUser user, BllTopic topic, bool isTopicStarter)
        {
            var newPost = CreateNewPost(postContent, user, topic.Id, isTopicStarter);
            _postRepository.Insert(newPost.ToDalPost());
            _uow.Save();

            return newPost;
        }
예제 #2
0
 private BllPost CreateNewPost(string content, BllMembershipUser user, Guid topicId, bool isTopicStarter)
 {
     if (content == null) return null;
     return new BllPost()
     {
         Id = Guid.NewGuid(),
         ParentTopicId = topicId,
         DateCreated = DateTime.UtcNow,
         DateEdited = (DateTime) SqlDateTime.MinValue,
         PostContent = content,
         IsTopicStarter = isTopicStarter,
         User = user
     };
 }
예제 #3
0
 public BllPost AddNewPost(string postContent, BllMembershipUser user, BllTopic topic, bool isTopicStarter)
 {
     return _postService.AddNewPost(postContent, user, topic, isTopicStarter);
 }
예제 #4
0
 public void ApplyRoleForUser(BllMembershipRole role, BllMembershipUser user)
 {
     user.Roles.Add(role);
     _userRepository.Update(user.ToDalUser());
     _uow.Save();
 }
예제 #5
0
 public void UpdateUser(BllMembershipUser user)
 {
     _userRepository.Update(user.ToDalUser());
     _uow.Save();
 }