-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
provide complete example for ViewModel with CreateVM.cshtml #13752
provide complete example for ViewModel with CreateVM.cshtml #13752
Comments
Thanks for the tip. |
Agreed. This section was a bit confusing. IMO, the CreateVM section should either be completely fleshed out with running code or removed. |
@tdykstra replace with InputModel approach with complete code. |
Agreed that we should do it that way, and this approach should be adopted in later tutorials as well, not just #2 CRUD. This will take some time to fix, so it will wait until higher priority 3.0 updates are done. |
@tdykstra given that view models are so widely used we should keep this too and maybe provide a GitHub link to the complete code. Automapper is pretty popular. |
In that case, we could switch CRUD to |
Good idea. Before we do, let's run it by the EF folks. |
As a newcomer, this section was extremely frustrating. The use of ViewModels in this context feels incomplete and left me with more questions than answers. Is TryUpdateModel preferred when doing Updates while ViewModels are better for Creation? How would an update with a ViewModel be implemented? I'm unfamiliar with InputModel, but it would make sense if the tutorial represented all three options on their own instead of having us utilize the TryUpdateModel and then scrap it for a ViewModel just to go back to TryUpdateModel. |
cc @tdykstra |
I agree this is confusing. I usually just skip over content like this in tutorials and books. Don't want to waste my time and brain power and get bogged down. I'm just moving on to the update section. |
I noticed the article talks about Create.cshtml and then mentions and links to a CreateVM.cshtml page when discussing View Models. I thought the CreateVM.cshtml link was a typo but there is in fact a page on Github that was created for purposes of the View Model, but no instruction to create it in the tutorial. Just throwing it out there as it may trip up newcomers (where did CreateVM.cshtml come from?).
@Rick-Anderson edit
StudentInputModel
StudentInputModel
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: