Esempio n. 1
0
        public async Task <IActionResult> Create(UserProfileCommentCreateViewModel viewModel)
        {
            UserProfileComment userProfileComment = new UserProfileComment
            {
                ID            = viewModel.UserProfileComment.ID,
                Body          = viewModel.UserProfileComment.Body,
                DateCreated   = DateTime.Now,
                CreatedByID   = userManager.GetUserAsync(HttpContext.User).Result.Id,
                CreatedBy     = await userManager.GetUserAsync(HttpContext.User),
                UserProfileID = viewModel.UserProfile.ID,
                UserProfile   = viewModel.UserProfile
            };

            await userProfileCommentService.InsertAsync(userProfileComment);

            return(RedirectToAction("Profile", "UserProfileComment", userProfileComment.UserProfileID));
        }
Esempio n. 2
0
 public async Task Insert([FromBody] UserProfileComment userProfileComment)
 {
     await userProfileCommentService.InsertAsync(userProfileComment);
 }