mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-16 14:15:57 -06:00
[GH-ISSUE #63] Support for dependency injection in Models #33
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MaxMommersteeg on GitHub (Aug 20, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/63
Currently working on a simple todo application (https://github.com/MaxMommersteeg/Qml.Net.TodoApp) and trying to use a repository in my model. I tend to use the
Models(as seen in the examples) as my controller (like a controller in mvc). Creating a controller/model without a parameterless constructor throws aSystem.MissingMethodExceptionexception.I setup my dependency injection as follows:
Program.cs
TodoItemsController.cs
Exception
System.MissingMethodException: 'No parameterless constructor defined for this object.'You can clone and run the
TodoApp.FrontEndproject to reproduce the problem. Any ideas on how to handle dependency injection?