예제 #1
0
        public void UpdateBlogGeneralSettings(int blogId, BlogGeneralSettingsPM generalSettings)
        {
            var blog        = BlogBiz.ReadSingle(b => b.Id == blogId);
            var updatedBlog = generalSettings.GetBlog();

            blog.Title       = updatedBlog.Title;
            blog.Description = updatedBlog.Description;
            blog.Email       = updatedBlog.Email;
            UnitOfWork.SaveChanges();
        }
예제 #2
0
        public int CreateBlog(UserIdentity UserIdentity, BlogGeneralSettingsPM blogRegisterationPM)
        {
            var blog = blogRegisterationPM.GetBlog();

            blog.CreatorId = UserIdentity.UserId;
            BlogBiz.CreateBlog(blog);
            UnitOfWork.SaveChanges();

            UserIdentity.HasBlog = true;
            UserIdentity.Blogs.Add(new ShortBlogInfoPM()
            {
                Id    = blog.Id,
                Name  = blog.Name,
                Title = blog.Title
            });
            return(blog.Id);
        }