Beispiel #1
0
        public async Task <bool> AddSocial(SocialServiceModel socialServiceModel)
        {
            Social social = socialServiceModel.MapTo <Social>();

            await this.socialRepository.AddAsync(social);

            var result = await this.socialRepository.SaveChangesAsync();

            return(result > 0);
        }
Beispiel #2
0
        public async Task <SocialServiceModel> EditSocialAsync(string artistId, SocialServiceModel socialServiceModel)
        {
            var social = socialServiceModel.MapTo <Social>();
            var artist = this.GetArtistById(artistId).MapTo <Artist>();

            artist.Social = social;
            this.artistRepository.Update(artist);
            var result = await this.artistRepository.SaveChangesAsync();

            return(socialServiceModel);
        }
Beispiel #3
0
        public async Task <bool> SetSocialAsync(string artistId, SocialServiceModel socialServiceModel)
        {
            var artist = await this.artistService.GetArtistAsync <ArtistSocialServiceModel>(artistId);

            await this.AddSocial(socialServiceModel);

            artist.Social = socialServiceModel.MapTo <Social>();

            var result = await this.artistService.UpdateSocialAsync(artist);

            return(result);
        }
Beispiel #4
0
        public async Task <IActionResult> AddSocial([FromRoute] string id, [FromForm] SocialServiceModel input)
        {
            try
            {
                bool result = await this.socialService.SetSocialAsync(id, input);

                return(this.Redirect(GlobalConstants.AccountMenager));
            }
            catch (System.Exception)
            {
                return(this.NotFound());
            }
        }
Beispiel #5
0
        public async Task <IActionResult> EditSocial(string id, SocialServiceModel input)
        {
            bool result = await this.socialService.SetSocialAsync(id, input);

            return(this.Redirect(GlobalConstants.AccountMenager));
        }