public IList <PersonDirectorDetailModel> GetAll()
 {
     using (var dbContext = _dbContextSqlFactory.CreateDbContext())
     {
         return(dbContext.Directors
                .Select(e => PersonDirectorMapper.MapMoviesPersonDirectorEntityToDetailModel(e))
                .ToList());
     }
 }
 public PersonDirectorDetailModel Create(PersonDirectorDetailModel model)
 {
     using (var dbContext = _dbContextSqlFactory.CreateDbContext())
     {
         var entity = PersonDirectorMapper.MapPersonDirectorDetailModelToEntity(model);
         dbContext.Directors.Add(entity);
         dbContext.SaveChanges();
         return(PersonDirectorMapper.MapMoviesPersonDirectorEntityToDetailModel(entity));
     }
 }
 public IList <PersonDirectorDetailModel> GetAllMovieDirectorByDirectorId(Guid id)
 {
     using (var dbContext = _dbContextSqlFactory.CreateDbContext())
     {
         return(dbContext.Directors
                .Where(t => t.DirectorId == id)
                .Select(e => PersonDirectorMapper.MapMoviesPersonDirectorEntityToDetailModel(e))
                .ToList());
     }
 }