Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ignatandrei/rscg_utilitytypes
Omit and Pick from TypeScript : https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys
https://github.com/ignatandrei/rscg_utilitytypes
Last synced: 5 days ago
JSON representation
Omit and Pick from TypeScript : https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys
- Host: GitHub
- URL: https://github.com/ignatandrei/rscg_utilitytypes
- Owner: ignatandrei
- License: mit
- Created: 2023-12-22T18:01:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-06T22:32:15.000Z (12 months ago)
- Last Synced: 2024-12-05T07:05:33.442Z (18 days ago)
- Language: C#
- Size: 20.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RSCG_UtilityTypes
Omit and Pick from TypeScript : https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys
generating also extension for converting from one type to another . See demo project.
## Usage
Add to your csproj file
```xml
```
In C# 9.0
```csharp
[Omit("MoviePreviewSmall", nameof(Actors),nameof(Year))]
[Pick("MoviePreviewMinimal", nameof(Title), nameof(Year))]
public class Movie
{
public string? Title { get; set; }
public string? Director { get; set; }
public int Year { get; set; }
public string[]? Actors { get; set; }
}
```And 2 new classes will be generated , MoviePreviewSmall and MoviePreviewMinimal
# More Roslyn Source Code Generators
You can find more RSCG with examples at [Roslyn Source Code Generators](https://ignatandrei.github.io/RSCG_Examples/v2/)