mirror of
https://github.com/adusak/Dependify.git
synced 2026-03-20 00:24:26 +01:00
Updated factory method documentation
This commit is contained in:
@@ -61,10 +61,10 @@ public class Audi : ICar, IFuelConsumer {
|
|||||||
|
|
||||||
## Factory method attributes
|
## Factory method attributes
|
||||||
|
|
||||||
If you want to add `Audi` as an implementation of `ICar` using factory method, you can do following
|
If you want to add `Audi` as an implementation of `ICar` using static factory method, you can do following
|
||||||
```c#
|
```c#
|
||||||
[RegisterTransientFactory(typeof(ICar))]
|
[RegisterTransientFactory(typeof(ICar))]
|
||||||
public Audi CreateAudi(IServiceProvider provider) {
|
public static Audi CreateAudi(IServiceProvider provider) {
|
||||||
return new Audi();
|
return new Audi();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user