You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/extensibility/controllers.md
+11-4
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
To expose API endpoints, ASP.NET controllers need to be defined.
4
4
5
+
## Auto-generated controllers
6
+
5
7
_since v5_
6
8
7
9
Controllers are auto-generated (using [source generators](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview)) when you add `[Resource]` on your model class:
@@ -14,7 +16,12 @@ public class Article : Identifiable<Guid>
14
16
}
15
17
```
16
18
17
-
## Resource Access Control
19
+
> [!NOTE]
20
+
> Auto-generated controllers are convenient to get started, but may not work as expected with certain customizations.
21
+
> For example, when model classes are defined in a separate project, the controllers are generated in that project as well, which is probably not what you want.
22
+
> In such cases, it's perfectly fine to use [explicit controllers](#explicit-controllers) instead.
23
+
24
+
### Resource Access Control
18
25
19
26
It is often desirable to limit which endpoints are exposed on your controller.
0 commit comments