SDCores 1.0.0

Suggested Alternatives

SDCores 1.2.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package SDCores --version 1.0.0
NuGet\Install-Package SDCores -Version 1.0.0
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="SDCores" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SDCores --version 1.0.0
#r "nuget: SDCores, 1.0.0"
#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 SDCores as a Cake Addin
#addin nuget:?package=SDCores&version=1.0.0

// Install SDCores as a Cake Tool
#tool nuget:?package=SDCores&version=1.0.0

SDCores in .Net core

2. DependencyInjectionConfiguration

Why should use DependencyInjectionConfiguration ?

Usually we need:

public interface IServiceA
{
    void Do();
}

public class ServiceA :IServiceA
{
    void Do(){
        // implementation 
    }
}

public class TestController : ControllerBase
{
    private readonly IServiceA _serviceA;

    public TestController(IServiceA serviceA)
    {
        _serviceA = serviceA;
    }
}

and then in Program.cs

using ...
var builder = WebApplication.CreateBuilder(args);
...
builder.Services.AddScoped<IServiceA, ServiceA>();
...

And if you have forgot to register your service(s) to the DI engine. This can be so annoying sometimes considering that you have already coded your service interface and its implementation and even used it by constructor injection in your controller or another service

System.InvalidOperationException: Unable to resolve service for type ... 
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, ...

That's why you should use DependencyInjectionConfiguration

[DependencyInjectionAttribute(ServiceLifetime.Transient)]
public interface IServiceA
{
    void Do();
}

And then just add this line to your ConfigureService method of your Program.cs like this

builder.Services.AddDependencyInjectionConfiguration(typeof(Program));

In every service interface by using the DependencyInjectionAttribute annotation and passing your desired service lifetime, your service will be automatically registered in the dotnet core DI engine.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.6 112 3/15/2024
1.2.5 243 10/30/2023
1.2.4 124 10/20/2023
1.2.3 131 10/10/2023
1.2.2 159 9/15/2023
1.2.1 143 9/15/2023
1.2.0 124 9/14/2023
1.0.2 148 9/6/2023
1.0.1 150 8/18/2023
1.0.0 174 8/17/2023