public void MethodName() { TaskDbContext taskDbContext = new cshh.Data.Services.DbContexts.TaskDbContext(); taskDbContext.Configuration.ProxyCreationEnabled = false; IQueryable <Task> tasks = taskDbContext.Tasks.Where(t => t.SupTaskId == null);//.Include(t => t.SubTasks);//.Include(t=>t.SupTask). List <Task> list = tasks.ToList(); IEnumerable <TaskVM> map = AutoMapper.Mapper.Map <IEnumerable <TaskVM> >(tasks); }