1

I have a C# list filled with data converted from a JSON file. Now I want to have CRUD functionality on the items in the list. I have made a model etc, to deserialize the JSON into the list. Now my question is. Can I use this list as my Database Context, so I don't have to connect to a database or whatever.

Model with properties:

enter image description here

Deserialize json:

enter image description here

Thanks in advance!

peer
  • 1,001
  • 4
  • 13
  • 29
  • 2
    Why would you need your list as a dbcontext? Just modify the list – Alexander Derck Apr 15 '16 at 07:59
  • @AlexanderDerck You've got a point there.. well since MVC delivers the CRUD system all easy and simple to setup.. I thought that would be easy to start with.. – peer Apr 15 '16 at 08:01
  • I suspect you confuse LINQ with EF? And somehow think that you need an EF-like provider to work with Lists? LINQ works on *any* type of collection as long as the proper provider is used. LINQ-to-Objects is built-in in .NET and works directly against *any* collection that implements `IEnumerable`. You don't have to do or add anything – Panagiotis Kanavos Apr 15 '16 at 08:02
  • Please post your code as text, not as a picture – Rob Apr 15 '16 at 08:02
  • @Peurr no, MVC does **NOT** deliver the database layer. You confuse this with Entity Framework. MVC is about architecting *web applications*, no matter where their data comes from - if they deal with data at all – Panagiotis Kanavos Apr 15 '16 at 08:03
  • @PanagiotisKanavos Oh, never thought about it that way. I've been thinking to hard there. Thanks for your advice. – peer Apr 15 '16 at 08:04

0 Answers0