hi folks
i have build everything in order to create a model from 2 models so that i can create a view for the single model. one table holds info for 1 quote and the second table holds a list of items within that quote.
the error i get is:
The model item passed into the dictionary is of type 'graniteConcepts.Controllers.QuoteViewModel', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[graniteConcepts.Controllers.QuoteViewModel]'.
here is my calling actionresult
public ActionResult finaliseQuote(string quoteid)
{
ViewData["quoteid"] = quoteid;
var model = new QuoteViewModel
{
quoteInfo = new_online_quote.SingleOrDefault(x => x.quoteid == Convert.ToInt32(quoteid)),
quoteItems = new_quote_item.Find(x => x.quote_id == Convert.ToInt32(quoteid))
};
return View(model);
}
and here is my custom model to hold the partnership:
public class QuoteViewModel
{
public new_online_quote quoteInfo { get; set; }
public IEnumerable<new_quote_item> quoteItems { get; set; }
}
i have tried IList, List and also tried having nothing
if i have nothing, ie it just new_quote_item quoteItems then i get an error:
on
quoteItems = new_quote_item.Find(x => x.quote_id == Convert.ToInt32(quoteid))
saying that IList cannot be converted to new_online_quote this is why i first tried it as an IList thinking one list would just drop into another.
im sure it is something small that i am missing but i just dont know what it is.
thanks