https://github.com/sql-mistermagoo/blazorpartialconstraint
Demonstrate Generic Component with Type Constraint
https://github.com/sql-mistermagoo/blazorpartialconstraint
Last synced: 4 months ago
JSON representation
Demonstrate Generic Component with Type Constraint
- Host: GitHub
- URL: https://github.com/sql-mistermagoo/blazorpartialconstraint
- Owner: SQL-MisterMagoo
- Created: 2019-12-13T02:27:36.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2020-06-15T16:17:45.000Z (about 6 years ago)
- Last Synced: 2025-10-07T14:41:11.200Z (9 months ago)
- Language: HTML
- Size: 204 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sample project demonstrates a constraint on a generic component
Please look at ConstrainedComponent in the Shared folder and its usage in Index.razor.
The compiler may not infer the type so you can specify the type as demonstrated here
``` HTML
```
Note: TItem="DateTime" tells the compiler that your generic type is a DateTime.