Have you considered adding an implicit converter so that if you try to assign a string value to a property of type FooId struct, it will implicitly convert that string to the ID Value?
Something along the lines of
[StronglyTypedId(backingType: StronglyTypedIdBackingType.String)]
public partial struct FooId {}
public class Foo {
public FooId FooId { get; init; } = "Initial_Id_String";
}
We're using Nanoid-Net to generate ID strings that are just as safe and almost as quick as UUID but are only 22 characters instead of 36. They're a bit more URL friendly (Youtube style IDs).
This would allow me to do this
[StronglyTypedId(backingType: StronglyTypedIdBackingType.String)]
public partial struct FooId {}
public class Foo {
public FooId FooId { get; init; } = Nanoid.Generate();
}
Instead of this
[StronglyTypedId(backingType: StronglyTypedIdBackingType.String)]
public partial struct FooId {}
public class Foo {
public FooId FooId { get; init; } = new FooId(Nanoid.Generate());
}
Am I making sense? Has this use case been considered. Happy to look at a PR.
Firstly, let me say, wonderful library.
Have you considered adding an implicit converter so that if you try to assign a string value to a property of type FooId struct, it will implicitly convert that string to the ID Value?
Something along the lines of
We're using Nanoid-Net to generate ID strings that are just as safe and almost as quick as UUID but are only 22 characters instead of 36. They're a bit more URL friendly (Youtube style IDs).
This would allow me to do this
Instead of this
Am I making sense? Has this use case been considered. Happy to look at a PR.