-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use IoC Container #258
Use IoC Container #258
Conversation
{ | ||
var services = new ServiceCollection(); | ||
|
||
services |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will also at some point have to add all the angor services, it is a good idea to do it this way, we can also add later a method .AddAngorServices()
namespace AngorApp.Composition; | ||
|
||
public class SectionsFactory(IServiceProvider serviceProvider) : ISectionsFactory | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are sections exactly? is this like sections of the UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the sections that appear in the Sidebar. Their have a ViewModel as content, and they are lazily loaded as needed.
Position = NotificationPosition.BottomRight | ||
} | ||
)) | ||
.AddSingleton<UIServices>(sp => new UIServices( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't all those services just get resolved automatically? why this hack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. Leftover from previous code... Will fix!
{ | ||
var loggerFactory = LoggerConfig.CreateFactory(); | ||
return new ProjectService( | ||
DependencyFactory.GetIndexerService(loggerFactory), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normally we do not pass the logger factory to services do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Microsoft.Extensions.DependencyInjection to better handling of dependencies.
Includes: