//code to set up the mapping ExpressMapper.Mapper.Register<Father, FlattenDto>().Flatten(); ExpressMapper.Mapper.Compile(CompilationTypes.Source); //code to execute the EF command and get the data var flattened = dbContext.Fathers.Project<Father, FlattenDto>().ToList();