mercredi 31 octobre 2018

The property context on type ProjectName.Repositories.MyRepo is not settable?

I am creating a mvc project to learn Repository pattern. i am using DBFirst approach + Entity Framework + Unity for DI. I am following this article:

https://www.dotnetcurry.com/aspnet-mvc/1155/aspnet-mvc-repository-pattern-perform-database-operations

I have followed this article and it's working fine. But after it I

created a new table in database Teacher and update the database

Later I add TeacherInfoRepository, In unityconfig file registered the TeacherInfoRepository

Add controller and then add view

I performed above steps as it is defined in the article I mentioned above. But after I tried running /Teachers/Index view It gives the error:

The property context on type ProjectName.Repositories.TeacherInfoRepository is not settable.

I searched on google but unfortunately didn't find something like this.

Please guide me. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire