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); }
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); }
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); }
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()); } }
public async Task <IActionResult> EditSocial(string id, SocialServiceModel input) { bool result = await this.socialService.SetSocialAsync(id, input); return(this.Redirect(GlobalConstants.AccountMenager)); }