public List <TEntity> GetByIds(List <long> ids) { return(ids.GroupBy(id => DbFactory.AnalysisNumber(id)) .SelectMany(items => { var config = DbFactory.GetDynamicDbConfigByNumber(typeof(TEntity), items.Key); return DynamicGetAll(new SampleRouter(config.DynamicCoden)) .Where(data => items.Contains(data.Id)); }).ToList()); }