Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Jan 22, 2025
1 parent d909085 commit 8e529e5
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions readme/BlazorServerApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// View Models
.Bind().To<ClockViewModel>()
Expand Down
1 change: 1 addition & 0 deletions readme/BlazorServerAppPageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// View Models
.Bind().To<ClockViewModel>()
Expand Down
1 change: 1 addition & 0 deletions readme/BlazorWebAssemblyApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// View Models
.Bind().As(Singleton).To<ClockViewModel>()
Expand Down
1 change: 1 addition & 0 deletions readme/BlazorWebAssemblyAppPageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// View Models
.Bind().As(Singleton).To<ClockViewModel>()
Expand Down
1 change: 1 addition & 0 deletions readme/GrpcService.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// Provides the composition root for Greeter service
.Root<GreeterService>();
Expand Down
1 change: 1 addition & 0 deletions readme/GrpcServicePageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// Provides the composition root for Greeter service
.Root<GreeterService>();
Expand Down
1 change: 1 addition & 0 deletions readme/Maui.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// Specifies not to attempt to resolve types whose fully qualified name
// begins with Microsoft.Extensions., Microsoft.Maui.
Expand Down
1 change: 1 addition & 0 deletions readme/MauiPageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// Specifies not to attempt to resolve types whose fully qualified name
// begins with Microsoft.Extensions., Microsoft.Maui.
Expand Down
1 change: 1 addition & 0 deletions readme/MinimalWebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
.Root<IWeatherForecastService>()
Expand Down
1 change: 1 addition & 0 deletions readme/MinimalWebAPIPageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
.Root<IWeatherForecastService>()
Expand Down
1 change: 1 addition & 0 deletions readme/WebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
// Provides the composition root for Weather Forecast controller
Expand Down
1 change: 1 addition & 0 deletions readme/WebAPIPageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
// Provides the composition root for Weather Forecast controller
Expand Down
1 change: 1 addition & 0 deletions readme/WebApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
// Provides the composition root for Home controller
Expand Down
1 change: 1 addition & 0 deletions readme/WebAppPageTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using static Pure.DI.Lifetime;
internal partial class Composition: ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
// Provides the composition root for Home controller
Expand Down
1 change: 1 addition & 0 deletions readme/service-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ partial class Composition : ServiceProviderFactory<Composition>

static void Setup() =>
DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind<IDependency>("Dependency Key").As(Lifetime.Singleton).To<Dependency>()
.Bind<IService>().To<Service>()
Expand Down
1 change: 1 addition & 0 deletions samples/BlazorServerApp/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace BlazorServerApp;
internal partial class Composition : ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// View Models
.Bind().To<ClockViewModel>()
Expand Down
1 change: 1 addition & 0 deletions samples/BlazorWebAssemblyApp/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace BlazorWebAssemblyApp;
internal partial class Composition : ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// View Models
.Bind().As(Singleton).To<ClockViewModel>()
Expand Down
1 change: 1 addition & 0 deletions samples/GrpcService/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace GrpcService;
internal partial class Composition : ServiceProviderFactory<Composition>
{
static void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
// Provides the composition root for Greeter service
.Root<GreeterService>();
Expand Down
1 change: 1 addition & 0 deletions samples/MinimalWebAPI/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace MinimalWebAPI;
internal partial class Composition : ServiceProviderFactory<Composition>
{
void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
.Root<IWeatherForecastService>()
Expand Down
1 change: 1 addition & 0 deletions samples/WebAPI/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace WebAPI;
internal partial class Composition : ServiceProviderFactory<Composition>
{
static void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
// Provides the composition root for Weather Forecast controller
Expand Down
1 change: 1 addition & 0 deletions samples/WebApp/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace WebApp;
internal partial class Composition : ServiceProviderFactory<Composition>
{
static void Setup() => DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind().As(Singleton).To<WeatherForecastService>()
// Provides the composition root for Home controller
Expand Down
5 changes: 4 additions & 1 deletion src/Pure.DI.MS/any/Pure.DI/MS/ServiceProviderFactory.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Pure.DI.MS
/// {
/// void Setup() =&gt;
/// DI.Setup(nameof(Composition))
/// // Use the DI setup from the base class
/// .DependsOn(Base)
/// .Root&lt;HomeController&gt;();
/// }
Expand All @@ -42,7 +43,9 @@ public class ServiceProviderFactory<TComposition>: IServiceProviderFactory<IServ
/// For example:
/// <code>
/// void Setup() =&amp;gt;
/// DI.Setup(nameof(Composition)).DependsOn(Base);
/// DI.Setup(nameof(Composition))
/// // Use the DI setup from the base class
/// .DependsOn(Base);
/// </code>
/// </example>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ partial class Composition : ServiceProviderFactory<Composition>

static void Setup() =>
DI.Setup()
// Use the DI setup from the base class
.DependsOn(Base)
.Bind<IDependency>("Dependency Key").As(Lifetime.Singleton).To<Dependency>()
.Bind<IService>().To<Service>()
Expand Down

0 comments on commit 8e529e5

Please sign in to comment.