Facet 1.0.0
See the version list below for details.
dotnet add package Facet --version 1.0.0
NuGet\Install-Package Facet -Version 1.0.0
<PackageReference Include="Facet" Version="1.0.0" />
<PackageVersion Include="Facet" Version="1.0.0" />
<PackageReference Include="Facet" />
paket add Facet --version 1.0.0
#r "nuget: Facet, 1.0.0"
#:package Facet@1.0.0
#addin nuget:?package=Facet&version=1.0.0
#tool nuget:?package=Facet&version=1.0.0
Facet
Facet is a compile-time source generator that creates partial classes from existing types — by copying only the members you want.
Exclude properties, include public fields, add your own members, or generate a constructor — all with a single [Facet]
attribute.
Use Facet to build lightweight DTOs, API shapes, or UI-bound view models without writing boilerplate or mapping code.
No base classes. No reflection. No runtime cost.
Features
- ✅ Exclude properties and fields with
nameof(...)
- ✅ Include public fields (optional)
- ✅ Generate constructors that copy from the source type
- ✅ Add your own extra properties in the generated type
- ✅ No base class or interface required
- ✅ No runtime reflection — compile-time only
- ✅ Works with or without namespaces
Quick Start
1. Install
dotnet add package Facet
2. Use
using Facet;
public class Person
{
public string Name { get; set; }
public string Email { get; set; }
public int Age { get; set; }
}
[Facet(typeof(Person), nameof(Person.Email))]
public partial class PersonWithoutEmail
{
}
3. What gets generated
public partial class PersonWithoutEmail
{
public string Name { get; set; }
public int Age { get; set; }
}
4 Extending
[Facet(typeof(Person),
excludes: new [] { nameof(Person.Email), nameof(Person.Age) } )]
public partial class PersonNameWithNote
{
public string Note { get; set; }
}
Becomes:
public partial class PersonNameWithNote
{
public string Name { get; set; }
public string Note { get; set; }
}
5 Constructors
[Facet(typeof(Person), nameof(Person.Email), GenerateConstructor = true)]
public partial class PersonDto { }
Now you can do:
var person = new Person();
var dto = new PersonDto(person);
Which results in:
public partial class PersonDto
{
public string Name { get; set; }
public int Age { get; set; }
public Guid RawId;
public PersonDto(Person source)
{
this.Name = source.Name;
this.Age = source.Age;
this.RawId = source.RawId;
}
}
Why Facet?
Why Facet? No mappings. No reflection. No bloated libraries.
Just clean, compile-time class shaping — with minimal syntax and full control.
Package Info
- Target frameworks: netstandard2.0
- Supports: .NET Core 3.1+, .NET 5+, .NET 6+, .NET 7, .NET 8
- Analyzer delivery: Source generator is embedded in the NuGet package
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Facet:
Package | Downloads |
---|---|
Facet.Extensions
Provider-agnostic extension methods for Facet. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.6.2 | 0 | 9/12/2025 |
2.6.1 | 53 | 9/10/2025 |
2.6.0 | 61 | 9/9/2025 |
2.5.0 | 285 | 9/4/2025 |
2.4.8 | 200 | 9/3/2025 |
2.4.7 | 243 | 9/1/2025 |
2.4.6 | 132 | 9/1/2025 |
2.4.5 | 202 | 8/30/2025 |
2.4.4 | 416 | 8/27/2025 |
2.4.3 | 189 | 8/27/2025 |
2.4.2 | 181 | 8/27/2025 |
2.4.1 | 215 | 8/26/2025 |
2.4.0 | 204 | 8/26/2025 |
2.3.0 | 1,546 | 8/20/2025 |
2.2.0 | 159 | 8/20/2025 |
2.1.0 | 267 | 8/18/2025 |
2.0.1 | 766 | 8/5/2025 |
2.0.0 | 155 | 8/4/2025 |
1.9.3 | 197 | 7/4/2025 |
1.9.1 | 156 | 7/3/2025 |
1.9.0 | 154 | 7/3/2025 |
1.8.0 | 253 | 6/4/2025 |
1.7.0 | 212 | 5/6/2025 |
1.6.0 | 180 | 4/27/2025 |
1.5.0 | 219 | 4/26/2025 |
1.4.0 | 144 | 4/25/2025 |
1.3.0 | 171 | 4/24/2025 |
1.2.0 | 176 | 4/24/2025 |
1.1.1 | 176 | 4/23/2025 |
1.1.0 | 181 | 4/23/2025 |
1.0.2 | 376 | 4/23/2025 |
1.0.1 | 191 | 4/23/2025 |
1.0.0 | 191 | 4/23/2025 |
0.1.0 | 183 | 4/22/2025 |