Autofac.EasyPropInject 1.0.0

.NET Core 2.1
There is a newer version of this package available.
See the version list below for details.
NuGet\Install-Package Autofac.EasyPropInject -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.
dotnet add package Autofac.EasyPropInject --version 1.0.0
<PackageReference Include="Autofac.EasyPropInject" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Autofac.EasyPropInject --version 1.0.0
#r "nuget: Autofac.EasyPropInject, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Autofac.EasyPropInject as a Cake Addin
#addin nuget:?package=Autofac.EasyPropInject&version=1.0.0

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


An extension i created to make it possible to to inject properties by attribute, without any other helper libs in .NET Core for Autofac.


This Branch is inactive besides minor fixes. We recommend to update your Autofac Dependency to 6.x. Easy Prop Inject 1.0.x supports all Autofac 4.x Versions

Autofac 6 Users please have a look at branch 1.2.x. Autofac 5.14+ Users please have a look at branch master and 1.1.x



Install-Package Autofac.EasyPropInject


dotnet add package Autofac.EasyPropInject



Go to "ConfigureServices" Make sure that you create the Autofac Container as usual for your Framework (Supported is .NET CORE 2.x) like its described here:

and then you create the instance BEFORE any registration.

   public IServiceProvider ConfigureServices(IServiceCollection services)
          var builder = new ContainerBuilder().AddEasyPropInject();
          //Add you services now as usual 

Usage in the Code

using Autofac.EasyPropInject.Annotations;
public class MyClass:IMyInterface 
    public MyClass(ISomeOtherInterface someService) 
    public IUnitOfWork unit { get;set; }

After "MyClass" is activated by autofac, "IUnitOfWork unit" will be resolved and set to the property.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.1

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.5 1,665 11/26/2021
1.2.4 1,570 11/26/2021
1.2.3 1,538 11/26/2021
1.2.2 337 10/18/2020
1.2.1 257 10/15/2020
1.2.0 264 10/15/2020
1.1.1 257 10/15/2020
1.1.0 257 10/15/2020
1.0.4 253 10/15/2020
1.0.1 258 10/15/2020
1.0.0 620 9/30/2018