DependencyModules.SourceGenerator.Impl
1.0.0-RC9024
This is a prerelease version of DependencyModules.SourceGenerator.Impl.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DependencyModules.SourceGenerator.Impl --version 1.0.0-RC9024
NuGet\Install-Package DependencyModules.SourceGenerator.Impl -Version 1.0.0-RC9024
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DependencyModules.SourceGenerator.Impl" Version="1.0.0-RC9024" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DependencyModules.SourceGenerator.Impl --version 1.0.0-RC9024
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DependencyModules.SourceGenerator.Impl, 1.0.0-RC9024"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DependencyModules.SourceGenerator.Impl as a Cake Addin #addin nuget:?package=DependencyModules.SourceGenerator.Impl&version=1.0.0-RC9024&prerelease // Install DependencyModules.SourceGenerator.Impl as a Cake Tool #tool nuget:?package=DependencyModules.SourceGenerator.Impl&version=1.0.0-RC9024&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DependencyModules
- Handles all service collection registration
AddSingleton
- Creates re-usable packages of registration methods, including an attribute allowing for easy re-use
- xUnit attributes that allow for easy unit testing and mocking
// Registration example
[DependencyModule]
public partial class MyDeps { }
[SingletonService(ServiceType = typeof(ISomeService)]
public class SomeClass : ISomeService { }
[TransientService]
public class OtherService
{
public OtherService(ISomeService service) { ... }
}
// Module usage example
var serviceCollection = new ServiceCollection();
serviceCollection.AddModule<MyDeps>();
var provider = serviceCollection.BuildServiceProvider();
var service = provider.GetService<OtherService>();
// Modules can be re-used with the generated attributes
[DependencyModule]
[MyDeps.Module]
public partial class AnotherModule { }
// unit tests example
[assemlby: MyDeps.Module]
[assembly: NSubstituteSupport]
public class OtherServiceTests
{
[ModuleTest]
public void SomeTest(OtherService test, [Mock]ISomeService service)
{
// assert implementation
}
}
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.10.0)
- Microsoft.Extensions.Primitives (>= 8.0.0)
- System.Memory (>= 4.5.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-RC9066 | 0 | 2/8/2025 |
1.0.0-RC9059 | 34 | 2/6/2025 |
1.0.0-RC9058 | 30 | 2/6/2025 |
1.0.0-RC9048 | 36 | 2/2/2025 |
1.0.0-RC9047 | 32 | 2/2/2025 |
1.0.0-RC9045 | 33 | 2/2/2025 |
1.0.0-RC9044 | 30 | 2/2/2025 |
1.0.0-RC9042 | 35 | 2/1/2025 |
1.0.0-RC9040 | 35 | 2/1/2025 |
1.0.0-RC9024 | 30 | 1/31/2025 |
1.0.0-RC9022 | 36 | 1/31/2025 |
1.0.0-RC9021 | 27 | 1/26/2025 |
1.0.0-RC9015 | 47 | 1/5/2025 |
1.0.0-RC9013 | 43 | 1/5/2025 |
1.0.0-RC9012 | 40 | 1/5/2025 |
1.0.0-RC9011 | 36 | 1/5/2025 |
1.0.0-RC9009 | 41 | 1/5/2025 |
1.0.0-RC9006 | 52 | 1/4/2025 |
1.0.0-RC9003 | 48 | 1/4/2025 |
1.0.0-RC9000 | 55 | 1/4/2025 |
1.0.0-RC8 | 53 | 1/4/2025 |
1.0.0-RC3 | 65 | 1/4/2025 |
1.0.0-RC2 | 67 | 1/4/2025 |
1.0.0-RC1 | 73 | 1/3/2025 |