You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I think this library is good candidate for creating complex objects, i.e.
public ClassA
{
public required int Prop1 {get; init;}
...
public required int PropN {get; init;}
}
However using this removes my compile-time safety, i.e. after adding PropN+1 existing builders will just assign default (0 or null) to it, rather than failing at compile time that PropN is not set.
I understand that doing such check at compile time may be not possible, however it would be nice to at least have possibility to do runtime check.
Proposed api:
[BuilderFor(typeof(ClassA), Strict = true)]
public partial class ClassABuilder
{
}
Then calling .Build() throws if WithPopX was called for each property, if no then it fails with exception.
The text was updated successfully, but these errors were encountered:
Hello, I think this library is good candidate for creating complex objects, i.e.
However using this removes my compile-time safety, i.e. after adding PropN+1 existing builders will just assign default (0 or null) to it, rather than failing at compile time that PropN is not set.
I understand that doing such check at compile time may be not possible, however it would be nice to at least have possibility to do runtime check.
Proposed api:
Then calling .Build() throws if WithPopX was called for each property, if no then it fails with exception.
The text was updated successfully, but these errors were encountered: