-
Notifications
You must be signed in to change notification settings - Fork 100
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
Filling a text list results in zero entries (syntax worked on AngelaSmith version) #126
Comments
This is definitely a bug. That syntax should work |
I went and put in a test for this because it seemed odd that it didn't work.
That test passed but maybe I'm interpreting what is expected here incorrectly. I also tried
I wonder if it might not be the lack of generic in your example code. Could you try
Instead? |
Something has become confused. The "Could you try..." you have provided is PRECISELY what I submitted to you as the NOT WORKING version. Here is the Person data model file: namespace SimpleSite.Models
namespace SimpleSite.Controllers
}` Here is the GenFu version of the PersonController which does NOT work because each and every Person generated has and empty Skills list. namespace SimpleSite.Controllers
}` |
I took your model
and, after fixing the incorrect initialization of the HashSet to a non-generic managed to duplicate your problem. It looks to me like initializing the HashSet in the constructor is the problem. I'd bet it is because we only fill properties that have default values and a non-null list isn't a default value. We could fill lists which are empty, I think that's a safe change to make but we should also consider this in conjunction with #121 which would be a more global solution to this sort of problem. I'll go ahead and add the filling of empty lists. |
For me, the puzzle arises because almost exactly the same code worked with the Alice version and that code came from a tutorial written by Mr. James, himself. (The GenFu version was posted by another person who did not seem to realize it wasn't working.) I'll look at #121 shortly. |
I cloned GenFu (about 2 hours ago), built it, and pointed my own project's reference to that .dll. Now GenFu is working as I had expected. Thank you to everyone who participated in this issue. |
This syntax was copied from AngelaSmith, where it works, to GenFu where it produces an empty list as output. There are no error messages.
.Fill(p => p.Skills, () => new List() { "Math", "Science", "History" })
The text was updated successfully, but these errors were encountered: