Description
Description
Across the source code, we can find properties of this kind :
private T Service { get; } = Ioc.Default.GetRequiredService<T>()
As of late, in order to do some small optimizations, we started to replace properties retrieving IUserSettingsService
by private readonly
fields instead. There are other types of settings that are fetched by the same process. We should replace them as well by fields of this format:
private readonly T service = Ioc.Default.GetRequiredService<T>()
(Note that the name variable starts by a lowercase letter)
Concerned code
- Whole solution.
Gains
- A slightly more optimized code.
- A more coherent code.
Requirements
private T Service { get; } = Ioc.Default.GetRequiredService<T>()
are made intoprivate readonly T service = Ioc.Default.GetRequiredService<T>()
- Public properties for sharing this format should be modified to look like this :
private readonly T service = Ioc.Default.GetRequiredService<T>();
public T Service
{
get => return service;
}
Comments
No response
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done