public IList <PersonActorDetailModel> GetAll() { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { return(dbContext.Actors .Select(e => PersonActorMapper.MapMoviesPersonActorEntityToDetailModel(e)) .ToList()); } }
public PersonActorDetailModel Create(PersonActorDetailModel model) { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { var entity = PersonActorMapper.MapPersonActorDetailModelToEntity(model); dbContext.Actors.Add(entity); dbContext.SaveChanges(); return(PersonActorMapper.MapMoviesPersonActorEntityToDetailModel(entity)); } }
public IList <PersonActorDetailModel> GetAllMovieActorByActorId(Guid id) { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { return(dbContext.Actors .Where(t => t.ActorId == id) .Select(e => PersonActorMapper.MapMoviesPersonActorEntityToDetailModel(e)) .ToList()); } }