Asp.net mvc models without databases / structure

Are there any tutorials / examples on how to create an asp.net mvc application without managing the model using the database (via linq2sql or the framework entity). I have to create an interface for a server that has json based api. I would like to use mvc 3 or 2 and have most of the mvc functions still in place (e.g. annotation and data validation). Any tutorials or examples on how to do this? I tried to look for them, but all the examples I found are based on an entity structure or linq.

+3
source share
2 answers

I agree that most examples / tutorials use an entity structure. The process will be similar:

  • Create model classes.
  • Create a repository that works with these model classes. This repository should implement an interface that contains all the necessary operations with models such as GetUser, SaveUseretc ... In the implementation, you connect to a remote JSON API server to retrieve data.
  • You create a controller that accepts the repository interface in the constructor. Install a custom factory controller so that the DI framework can provide instances of your controllers.
  • Define views and view model classes.
  • , , .

:

+2

MVC 3 JSON, , , .

MVC 2.

0

Source: https://habr.com/ru/post/1772709/


All Articles