Menu
In short, Unity scans the objects in the container for attributes which extend HandlerAttribute. Thus Unity can get the actual CallHandler class and apply its logic around the target method. The proposed handler begins a transaction with an optionally defined isolation level, executes the target method and either commits or rolls the transaction back depending on the presence of errors.
As you can see in the above sample classes, the Driver class is dependent on a property of type ICar. So, we need to set an object of a class that implements ICar to the Car property using Unity container.Property injection in Unity container can be implemented in two ways:. Using the Dependency attribute. Using run-time configurationDependency AttributeFor the property injection, we first tell the Unity container which property to inject. So, we need to decorate the dependent properties with the Dependency attribute, as shown in the following Driver class.