protected ProfileViewModel SetAuthorDetails(UserGeneratedBaseViewModel vm) { if (vm == null) { return(null); } if (vm.Id == Guid.Empty || vm.UserId == Guid.Empty) { vm.UserId = CurrentUserId; } ProfileViewModel profile = ProfileAppService.GetUserProfileWithCache(vm.UserId); if (profile != null) { vm.AuthorName = profile.Name; vm.AuthorPicture = UrlFormatter.ProfileImage(vm.UserId); } return(profile); }
protected static void SetBasePermissions(Guid currentUserId, UserGeneratedBaseViewModel vm) { vm.Permissions.CanEdit = vm.UserId == currentUserId; vm.Permissions.CanDelete = vm.UserId == currentUserId; }
public static void SetShareUrl(this UserGeneratedBaseViewModel vm, string url) { vm.ShareUrl = url; }
public static void SetShareText(this UserGeneratedBaseViewModel vm, string text) { vm.ShareText = text; }