I want to create a simple REST-API (or maybe later in combination with GraphQL).
PS: I'm using C#.NET Core / .NET-5.0 and PostGreSQL. Working with Rider with an "empty solution".
API-Controller | Models | Services | Repositories | Database |
---|---|---|---|---|
Request | InputModel | DataValidation, DataManipulation, IPO | DB-Entities | SQL-Code |
Response | OutputModel | DataManipulation, DataValidation, IPO | DB-Entities | SQL-Code |
So I have this structure (directories):
- Controllers { ... }
- Models
- Commons { ... }
- Inputs { ... }
- Entities { ... }
- Outputs { ... }
- Services { ... }
- PgsqlRepository { ... }
In my mind, the VIEW of a REST API is the combination of the "end point" and the "output model".
Both are provided by the corresponding API controller.
So where exactly is the VIEW in the MVC for a REST API?
Or is a backend interface (with REST API) not a classic MVC at all?
And yes, the MVVM in the frontend naturally offers a VIEW and a ViewModel.
But my question is only about the backend.