public int?AddArtist(AboutTheArtistViewModel artist) { AboutTheArtist model = _mapper.Map <AboutTheArtist>(artist); dbContext.aboutTheArtists.Add(model); var result = this.dbContext.SaveChanges(); return(result); }
public AboutTheArtistViewModel getArtistById(bool isAdmin, int id) { AboutTheArtist result = new AboutTheArtist(); if (isAdmin) { result = this.dbContext.aboutTheArtists.FirstOrDefault(x => x.Sno == id); } else { result = this.dbContext.aboutTheArtists.FirstOrDefault(x => x.Sno == id); } if (result == null) { return(null); } return(_mapper.Map <AboutTheArtistViewModel>(result)); }