Example #1
0
        public ProfileViewModel GetProfileViewModel(Profile profile)
        {
            var viewModel = Mapper.Map <Profile, ProfileViewModel>(profile);

            viewModel.IsOwner = true;
            return(viewModel);
        }
Example #2
0
        public ProfileTattoosViewModel GetProfileLikedTattoosViewModel(Profile profile)
        {
            var viewModel = Mapper.Map <Profile, ProfileTattoosViewModel>(profile);

            viewModel.Profile.IsOwner = true;
            return(viewModel);
        }
Example #3
0
        public CommentViewModel GetCommentViewModel(Profile profile, string text)
        {
            var commentViewModel = new CommentViewModel();

            commentViewModel.Profile = Mapper.Map <Profile, ProfileViewModel>(profile);
            commentViewModel.Text    = text;
            return(commentViewModel);
        }
Example #4
0
        public async Task <TattooCreateInputModel> GetTattooCreateViewModel(Profile profile)
        {
            var styles = await _styleService.GetStyles();

            var viewModel = Mapper.Map <Profile, TattooCreateInputModel>(profile);

            viewModel.StylesCheckBoxes = Mapper.Map <IReadOnlyCollection <Style>, List <StyleCheckboxModel> >(styles);
            return(viewModel);
        }
Example #5
0
        public ProfileTattoosViewModel GetProfileTattoosViewModel(Profile profile, int userProfileId)
        {
            var viewModel = Mapper.Map <Profile, ProfileTattoosViewModel>(profile);

            if (profile.Id == userProfileId)
            {
                viewModel.Profile.IsOwner = true;
            }
            if (profile.Followers.Any(x => x.ProfileId == userProfileId))
            {
                viewModel.Profile.IsFollowed = true;
            }
            return(viewModel);
        }
Example #6
0
        public Task <TattooEditViewModel> GetTattooEditViewModel(TattooEditInputModel inputModel, Profile profile)
        {
            var viewModel = Mapper.Map <TattooEditInputModel, TattooEditViewModel>(inputModel);

            viewModel.Albums = Mapper.Map <List <Album>, List <SelectListItem> >(profile.Albums);
            viewModel.Albums.Add(new SelectListItem()
            {
                Text = "None", Value = "0", Selected = true
            });
            return(Task.FromResult(viewModel));
        }