Exemplo n.º 1
0
        public List <T> Read <T, EfType>(Expression <Func <EfType, bool> > predicate) where T : WidgetViewModelBase
        {
            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <WidgetBase, T>();
                cfg.CreateMap <EfType, CpuWidgetViewModel>();
            });
            var query = _widgetRep.GetQueryable().OfType <EfType>().Where(predicate).ProjectTo <T>(config).ToList();

            return(query);
        }