doetnet core - rest API + SQL server - possible to go not MVC (only controller?) | بلاگ

doetnet core - rest API + SQL server - possible to go not MVC (only controller?)

تعرفه تبلیغات در سایت

آخرین مطالب

امکانات وب

Vote count: 0

Am abit struggling here with doing proof of concepts in C# and dotnet core, i actually like dotnet core and wish i could implement my API Server in it ( api server that is doing jobs on a database ).

But one thing that really gets to me when developing in proof of concept where database changes all the time and code needs to get updated with ping pong to REST clients is that it seems i need to follow MVC structure ( or MxC as theres really no view ).

Isnt it possible to create a controller only so all my code including accessing my database ( i dont want to create a model firsti will hardcode the names first as things in POC fase changes constantly ) - then sometime in the end it can be converted into a MVC structure.

Abit similar to when im doing API's in python or node.js - you write you are free to write the code completely in the controller and can work directly with json deserialzation instead needing to maintain both models and controller.

If anyone got an example of doing all in controller towards a SQL server ( ex. api /GetAll - will perform "select * from dbo.allcars" and return that - only in the controller function i would be absolutely thankful.

(and im newbie dotnet core so sorry if im asking the obvious - but even though newbie i really dont want to conform to the MVC as it takes out development time here in the proof of concept phase )

asked 46 secs ago
MT drip

...
نویسنده : استخدام کار بازدید : 6 تاريخ : يکشنبه 24 تير 1397 ساعت: 16:29