I have a web API application that uses a single controller that returns data read from a file.
So, all I use is part of the C (Controller) MVC. I have no views, and I also do not use models - I store and retrieve data in / from the App_Data folder.
I know this is a fairly simple solution, but it seems that all I need is C, not MVC. Did I miss something?
Model-View-Controller is a design template to help structure GUI applications. ASP.NET MVC is an environment that helps you build a web application according to this design pattern.
The web API has nothing to do with the MVC design pattern. It was developed separately, temporarily distributed under the same umbrella name, and now with its own structure: http://www.asp.net/web-api
The fact that some project templates still create the Model and Views catalogs in your project means that you are using an outdated project template or one that assumes you want MVC and web API in the same project .
CodeCaster "" . , , , , , -API , ASP.NET MVC.
Visual Studio 2013 -. , . Web Api. . -Api (, , , ), - MVC " " , , , "" ( ): :
Ok , API MVC. , , .
, "" -API, , -API, :
, -API.
, , . , , . . . MVC, .
, /, , . , Model View , , . , MS ASP.NET MVC , , MVC - MS. (, EF-, Razor views) .
, ( POST), JSON ( GET). GET/POST? GET POST. , JSON , .
If we do not consider the data returned by the controller action as a representation, a representation of your data, and not an HTML representation, the design pattern does not indicate the type of representation. In my opinion, this is still MVC, the model still exists, and you would usually create the model of your data that you want to return, part of the view is just another model or a representation of your main model classes.
Source: https://habr.com/ru/post/1622449/More articles:ImportError: cannot import name RemovedInDjango19Warning - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1622444/what-data-types-to-use-when-porting-this-recursive-structure-from-python-to-java&usg=ALkJrhhAqjzJICJDoybBXKMrbe_zjH94UQCustom WooCommerce field in Checkout - phpTrend endpoint not working - foursquareI cannot save a character string in a node of a linked list - cИспользование преемника ML с SML/NJ - smlPython 3 virtual environment update - pythonAdjacent adjacency matrices - matrixUsing the ArangoDB Index with Edge Sets - performanceHow to lag an integer variable using R? - rAll Articles