In my controller I return a list which is a result of joining 2 tables. Now I want to pass this list to my view but can't do this. Such error occurs:
System.Collections.Generic.List1[<>f__AnonymousType2 [System.String,System.String,System.String,... etc etc], while this dictionary needs element of type System.Collections.Generic.IEnumerable[XYZ.Models.MyModelTable].
        public ActionResult someAction()
        {
            BASEdb db = new BASEdb();
            var model = db.MyModelTable
                            .Join(db.Customers,
                            z => z.FOPKTO_, k => k.ID,
                            (z, k) => new { FOPKTO = z, Customers = k })
                            .Where(w => w.FOPKTO.Date == null)
                            .Select(s => new
                                     {
                                      s.Customers.Name,
                                      s.MyModelTable.FOPKTO,
                                      s.MyModelTable.FOPBDA,
                                      s.MyModelTable.FOPGSS,
                                      })
                             .ToList();
            return View(model);
        }
and my View:
@model IEnumerable<XYZ.Models.MyModelTable>
    @{
        ViewBag.Title = "Invoices";
        Layout = "~/Views/Shared/_Layout.cshtml";
    }
    <h2>Invoices</h2>
    <table class="table">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.FOPBDA)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.FOPLBN)
.... etc. (there's foraeach instruction below as well)
How can I pass list which return data from 2 tables to View? my view now takes type of one table (MyModelTable)? It shoudl be more generic type I think but have no idea how to get around it
 
     
     
     
    