I'm trying to get a simple example of Telerik ORM running on my site. I have a DAL
which is a separate Visual Studio project.
I also have an MVC5
application. Both projects are tied to a single solution. Pretty standard setup.
In my DAL
project, I have a simple repository that returns an object of type Topic
that is retrieved from the DB
. My code looks like this:
Repository:
public class Repository
{
public Topic Get(int id)
{
var fluentModel = new FluentModel();
return fluentModel.Topics.Where(t => t.Id == 1).FirstOrDefault();
}
}
Topic:
public class Topic
{
public int Id { get; set; }
public string Headline { get; set; }
}
When I call the repository in my controller:
public ActionResult Index()
{
var repository = new Repository();
Topic x = repository.Get(1);
return View();
}
At compile, my MVC
project is throwing an error. I need to include the Telerik.OpenAccess
assembly to stop the error. I've already included my Data
assembly in my MVC
project, so I'm curious why my MVC
project cares? I'm simply returning a Topic
. Why does my MVC
project need access to Telerik.OpenAccess
? How can I avoid this. I don't want my MVC
project to know about Telerik
.