-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ISpecimenBuilder as param on With method #1444
Adding ISpecimenBuilder as param on With method #1444
Conversation
@dotnet-policy-service agree |
@aivascu The pipeline is failing due to previous .NET versions, and I've noticed recent PRs adding .NET 5 runtime like on #1443 being merged to the release branch. May this PR be based on release/5.0.0 instead of the master branch? Couldn't find info about it on the code docs. I was able to build, test, and pack it locally but the cmd script fails. |
@luccanog the errors thrown by the pipeline are related to the SDK building the code. Looks like AppVeyor have updated their VS 2019 image. I'll add the errors to ignore list. |
Looks like they outright removed .net core 1 and 2, and I've just finished re-balancing all versions on the release branch... |
@aivascu The rebase is done. |
@luccanog yes please undo the readme. I'll synchronize them in a separate PR. |
@aivascu I came back with the old content, but for some reason git hub still thinks there is a difference between files. It might be irrelevant to the process |
6f796d5
to
ad5889b
Compare
@luccanog I've rebased and squashed your commits on the release branch. I hope you don't mind. I've had a brief look at your implementation, but I'm not done reviewing it for now. Will let you know if I come up with anything. |
@aivascu No problem at all, feel free to do any other rebase if needed. About he piggybacking, do you mean the changes at the NodeComposer class? There I re-used an existent overload since the method has got what we need, but of course we have some other ways. As I see, we could call the In this way our new Please let me know when you got any thoughts. |
@luccanog yes, I meant that you reused the builder syntax, to create a factory that's using the specimen builder. 😅 Using the BindingCommand sounds better however I propose that we add a new overload for the public constructor. public BindingCommand(Expression<Func<T, TProperty>> propertyPicker, ISpecimenBuilder builder)
{
if (propertyPicker is null) throw new ArgumentNullException(nameof(propertyPicker));
if (builder is null) throw new ArgumentNullException(nameof(builder));
this.Member = propertyPicker.GetWritableMember().Member;
this.ValueCreator = c => (TProperty)builder.Create(typeof(TProperty), c);
} This would allow to pass the context directly into the builder and avoid going through several layers of abstractions. Let me know if you'll try these changes, and cover them with tests. |
I just implemented the new |
@luccanog after some consideration, I decided I don't want yet to couple |
@aivascu alright. Thank you! |
Description
Accepting
ISpecimentBuilder
interface as value generator forWith
method:Closed issues
#1421
Checklist