Итак, я преследую это приложение MVC, и все работает плавно. Я встаю, чтобы исправить укус, чтобы поесть и в следующий раз я строю, я поздоровался с 4 из этих ошибок:Невозможно неявно преобразовать тип с IEnumerable
> Error 16 Cannot implicitly convert type
> 'System.Collections.Generic.IEnumerable<>
> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll]'
> to
> 'System.Collections.Generic.IEnumerable<>
> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll]'.
> An explicit conversion exists (are you missing a cast?)
Имейте в виду, что есть на самом деле что-то в IEnumerable <>, я просто удалил его.
Это в 2 классах, где ошибки находятся в
public partial class PriceListController : Controller
{
[CanonicalUrlAttribute("PriceList")]
[CompressionFilter(Order = 1)]
[CacheFilter(Duration = 120, Order = 2)]
public virtual ActionResult Index()
{
GodsCreationTaxidermyEntities context = new GodsCreationTaxidermyEntities();
var viewModel = new PriceListViewModel() { PriceListAnimals = context.GetAnimalListForPriceList() };
return View(viewModel);
}
[CompressionFilter(Order = 1)]
[CacheFilter(Duration = 120, Order = 2)]
public virtual ActionResult List(string animal)
{
GodsCreationTaxidermyEntities context = new GodsCreationTaxidermyEntities();
var viewModel = new PriceListIndexViewModel() { AnimalPrices = context.GetPriceListByAnimal(animal) };
return View(viewModel);
}
}
public partial class GalleryController : Controller
{
//
// GET: /Gallery/
[CanonicalUrlAttribute("Gallery")]
[CompressionFilter(Order = 1)]
[CacheFilter(Duration = 120, Order = 2)]
public virtual ActionResult Index()
{
GodsCreationTaxidermyEntities context = new GodsCreationTaxidermyEntities();
var viewModel = new GalleryIndexViewModel() { GalleryAnimals = context.GetAnimalListForGallery() };
return View(viewModel);
}
[CompressionFilter(Order = 1)]
[CacheFilter(Duration = 120, Order = 2)]
public virtual ActionResult List(string animal)
{
GodsCreationTaxidermyEntities context = new GodsCreationTaxidermyEntities();
var viewModel = new GalleryListViewModel() { GalleryImages = context.GetGalleryImageByAnimal(animal) };
return View(viewModel);
}
}
Я проверил DAL и Repository и ошибок не приходит оттуда.
Возможно, если вы указали какой-то код, где происходит исключение? –
IIS Я предполагаю? Попробуйте запустить утилиту IISReset для сброса сервера (должен запускаться как администратор), а затем перестроить. – IDWMaster
Хм, можем ли мы увидеть больше кода? Где именно это бросает исключение? – tobias86