commandlineparser / commandlineparser/commandline
Treat .NET 7 `required` properties as actually required by default
Đang mở
- Ngôn ngữ chính
- C#
- Star
- 4.8k
- Fork
- 478
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**Code snippet:**
```cs
public class Options
{
[Option]
public required int Port { get; init; }
[Option]
public required string Server { get; init; }
}
```
**Expected behaviour:** Both `Port` and `Server` are required and the parsing fails if at least on of them is not present.
**Actual behaviour:** They are not required, I still have to specify `[Option(Required = true)]` in order for it to work
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.