gh9
gh9

Reputation: 10703

Using web api in a web forms environment

Why does the WebApi controller have to end in the word Controller to work in a web forms environment?Microsoft demo referenced this post

Note: Make sure the name ends in “Controller” and not “Controller1” or similar.

Upvotes: 1

Views: 76

Answers (1)

Paul Sasik
Paul Sasik

Reputation: 81459

Because it is part of Microsoft's strategy (many software companies are following this paradigm) of Convention Over Configuration for their newer technologies.

Wikipedia entry:

Convention over configuration (also known as coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility. The phrase essentially means a developer only needs to specify unconventional aspects of the application. For example, if there's a class Sale in the model, the corresponding table in the database is called “sales” by default. It is only if one deviates from this convention, such as calling the table “products_sold”, that one needs to write code regarding these names. When the convention implemented by the tool matches the desired behavior, it behaves as expected without having to write configuration files. Only when the desired behavior deviates from the implemented convention is explicit configuration required.

Upvotes: 2

Related Questions