Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
docs(di): Add Dependency feature (#75)
Browse files Browse the repository at this point in the history
* feat: Add extensions to the service

* feat: Add DependencyAttribute

* fix: Fix TryRegister

* fix: Services are allowed to be registered only once

* chore: Modify README.md

* docs(DI): Improve Dependency feature documentation
  • Loading branch information
zhenlei520 committed Jun 21, 2022
1 parent 16a70c2 commit f1dd339
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ Scan the interfaces and classes that inherit ISingletonDependency, IScopedDepend
## Features:

* IgnoreInjection: Ignore injection, used to exclude not being injected automatically
* Dependency:
* TryRegister: Set true to be registered only when the service is not registered, similar to TryAdd of IServiceCollection... extension method
* ReplaceServices: Set true to replace previously registered services, similar to the Replace... extension method of IServiceCollection.

## Methods:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public interface IRepository<TEntity> : IScopedDependency
## 特性:

* IgnoreInjection: 忽略注入,用于排除不被自动注入
* Dependency:
* TryRegister: 设置true则仅当服务未注册时才会被注册,类似IServiceCollectionTryAdd ... 扩展方法
* ReplaceServices: 设置true则替换之前已经注册过的服务,类似IServiceCollectionReplace ... 扩展方法.

## 方法:

Expand Down

0 comments on commit f1dd339

Please sign in to comment.