https://github.com/blowin/blowin.required
Implementation of proposal https://github.com/dotnet/csharplang/issues/3630
https://github.com/blowin/blowin.required
analyzer roslyn roslyn-analyzer
Last synced: 4 months ago
JSON representation
Implementation of proposal https://github.com/dotnet/csharplang/issues/3630
- Host: GitHub
- URL: https://github.com/blowin/blowin.required
- Owner: blowin
- Created: 2021-10-07T04:49:36.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-17T14:19:09.000Z (about 4 years ago)
- Last Synced: 2025-05-11T19:40:13.025Z (5 months ago)
- Topics: analyzer, roslyn, roslyn-analyzer
- Language: C#
- Homepage:
- Size: 449 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blowin.Required

| Source | Link |
| ----------- | ----------- |
| VSIX | [](https://marketplace.visualstudio.com/items?itemName=Blowin.requiredproperty) |
| Nuget | [](https://www.nuget.org/packages/Blowin.Required/) |Implementation of proposal 'Required Properties'
https://github.com/dotnet/csharplang/issues/3630Add required attribute to property and enjoy :)
```c#
public class Person
{
public string Name { get; set; }
[Required]
public int Age { get; set; }
}
```You can use DataAnnotation, or any attribute with name Required
Support diagnostics:
1. Required property must be initialized (initializer)
2. Type can't be used as generic parameter with new() restriction
3. If constructor initialization of required property, it should be initialized in any execution path### Success cases:



### Fail cases:





