简体   繁体   中英

Asp.Net core web api with out Models [on hold]

Maintaining project structure without models directory and used all the methods with interface and its implementation class files (Dynamic injections).

Controller

  • HomeController.cs

Objects

  • Settings.cs

Services

  • ILogic.cs

  • Logic.cs

Settings.cs holds all the properties declarations.

Is this correct project structure to implement asp.net core web api 3.0?

One of the main reasons we love C# is the same reason some people hate it. It's strongly typed.
If you are using dynamic for a method to be able to process multiple objects, take a look at generics: Generics - Microsoft

The implementation you speak of may work, but it's difficult to test and sounds overly complicated for most use cases.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM