Closed alexbarbato closed 7 years ago
Hey, I'd like to grab this one and started to work though the example project. As far as i understood this Factory functionality, it provides a way to specify default values for mapped entities. Are there any other interesting use cases?
Hey thanks for offering to help! I'm going to mark this as claimed and it's all yours.
I think you're pretty right that one way you can use the AssignFactory function is to apply default values to generated objects from the Factory. I think the potentially cooler use case, we don't have a text example of yet, is when you apply a context to the factory because you can be a bit more dynamic with the resulting object as the context doesn't necessarily have to be hard coded to a single value.
@undiwahn, please let me know if this sounds completely out in left field too please!
Let me know if that helps/doesn't and I can get you a more concrete example should the need be. Thanks again :)
I tried to find a fitting example in my last commit fdcbd35. Could someone please have a look if thats a good example? Its about employment types that, if not explicitly requested, responds with a generic "Employed" information. If it's included in the request, you'll get the detailed Information (eg. FullTime/PartTime)
Saw your PR, thanks a ton! Let's give it a couple of days for everyone to have a chance to review (myself included), but it looks like an awesome go from the little I've looked at so far
Thanks for the Feedback, I'm glad that i could help :)
Pull request accepted and merged!
Detailed Description
In PopcornConfiguration.cs we define the ability to assign a factory, both with and without a context provided. We want to document how to use these functions so as to make them accessible to users.
Possible Implementation