I am darned new to the world of MVC 5 .NET... I am trying to get my head around the Tree Control from Ignite UI.

I need to retrieve my data from my model and pass it to my view... However, I keep getting the following error:

> 
> The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery`1[System.String]', but this dictionary requires a model item of type 'System.Linq.IQueryable`1[DataViewer.Models.Viewer]'.
> 
> 
> 

Here is my model:

```
namespace DataViewer.Models
{
    [Table("dbo.table")]
    public class Viewer
    {
        [Key, Column(Order=0)] public long id { get; set; }
        public int Revision { get; set; }
        public string GeoPSRType { get; set; }
        public string GeoName { get; set; } 
        public string L2Name { get; set; }  
        public string L3Name { get; set; }
    }
}

```

etc.

And my Controller:

```
namespace DataViewer.Controllers
{
    public class ViewerController : Controller
    {
        private ViewerDBContext db = new ViewerDBContext();

        public ActionResult Index()
        {
            var result = db.Items.Select(i => i.GeoName).Distinct().OrderBy(n => n);

            return View(result);
        }
    }
}

```

And my view:

```
@model IQueryable<DataViewer.Models.Viewer>

@using Infragistics.Web.Mvc

@(Html.Infragistics().Tree()
        .DataSource(Model)
        .Bindings(b =>
            b.TextKey("GeoName")
            .PrimaryKey("ID")
            .ValueKey("ID")
            .ChildDataProperty("L2PSRType")
            )
        )
        .DataSource(Model)
        .LoadOnDemand(true)
        .DataSourceUrl(Url.Action("tree-data-on-demand"))
        .DataBind()
        .Render()
)

```

I figured the issue was that I should be passing a strongly typed return-type by using 

```
IQueryable<Viewer> result = 
db.Items.Select(i => i.GeoName).Distinct().OrderBy(n => n);

```

but that throws a different error:

```
InvalidOperationException: The model item passed into the dictionary is of type 
'System.Data.Entity.Infrastructure.DbQuery`1[System.String]', 
but this dictionary requires a model item of type 
'System.Linq.IQueryable<DataViewer.Models.Viewer>.' 
An explicit conversion exists, are you missing a cast?

```

Is this relating to the fact that I'm pretty rusty on strongly typed syntax, or am I just being a total maroon (or is it a combination)?

P.S. Also, I have no doubt that the Infragistics().Tree() portion of the view is not correct, I am really more concerned about getting my data to my view (at this point). I just wanted to include all code I had...