0

My company has a product that ultimately exposes a bunch of object types that I want to be able to interact with via a custom DbContext and DbSet classes so that I can perform CRUD activities against them in an MVC based website.

So basically what I want to do is have the equivalent of DbContext (http://msdn.microsoft.com/en-us/library/gg679505(v=vs.103)) and DbSet such that they are not tied into a database in the background, but point at our server product instead.

But I have no real idea on how to do this. Is this even possible or would it be some kind of nightmare to achieve. I've searched around but have not had much luck finding anything of this nature, which probably indicates that it is a nightmare.

Any pointers in the right direction is much appreciated.

Thanks

tereško
  • 58,060
  • 25
  • 98
  • 150
  • 2
    `DbContext` will connect to a database, and I wouldn't recommend attempting to change that. But you could use MVC without Entity Framework, see [here](http://stackoverflow.com/questions/4080841/asp-net-mvc-models-without-databases-framework) for some more details. –  Sep 11 '12 at 16:55

1 Answers1

-1

See if this helps: Write a custom DbContext

Display Name
  • 4,672
  • 1
  • 33
  • 43
  • Hi. Was it of any help for you please? – Display Name Sep 19 '12 at 17:17
  • Why would that help? He's asking about a DbContext that isn't using a SQL database. – Casey Mar 24 '14 at 15:29
  • He's probably asking for a NOTDbContext. I've heard for ObjectContext and that it was being used in old EF versions. Try making a custom ObjectContext that is not a DbContext and pass that instead of a DbContext where needed. – Dexter Jan 25 '17 at 13:12