From 2661484c0f931ad4e29b98d48263f94504fed5f9 Mon Sep 17 00:00:00 2001 From: Oleksandr Liakhevych Date: Thu, 13 Jun 2024 13:04:31 +0300 Subject: [PATCH] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7168b50..5bdf511 100644 --- a/README.md +++ b/README.md @@ -61,13 +61,13 @@ Unlike using `FluentValidation.DependencyInjectionExtensions` package, `ServiceS ``` It adds MediatR handlers, which would work for simple cases, although you might need to add other types like PipelineBehaviors or NotificationHandlers. -### Add types from your project based on name filter as their implemented interfaces: +### Add all repository types from your project based on name filter as their implemented interfaces: ```csharp [GenerateServiceRegistrations( - TypeNameFilter = "MyNamespace.*Service", + TypeNameFilter = "*Repository", AsImplemetedInterfaces = true, Lifetime = ServiceLifetime.Scoped)] - private static partial IServiceCollection AddServices(this IServiceCollection services); + private static partial IServiceCollection AddRepositories(this IServiceCollection services); ``` ## Parameters @@ -77,7 +77,6 @@ It adds MediatR handlers, which would work for simple cases, although you might | --- | --- | | **FromAssemblyOf** |Set the assembly containing the given type as the source of types to register. If not specified, the assembly containing the method with this attribute will be used. | | **AssignableTo** | Set the type that the registered types must be assignable to. Types will be registered with this type as the service type. | -| **AssignableTo** | Set the type that the registered types must be assignable to. Types will be registered with this type as the service type. | | **Lifetime** | Set the lifetime of the registered services. `ServiceLifetime.Transient` is used if not specified. | | **AsImplementedInterfaces** | If true, the registered types will be registered as implemented interfaces instead of their actual type. This option is ignored if `AssignableTo` is set. | | **TypeNameFilter** | Set this value to filter the types to register by their full name. You can use '*' wildcards. You can also use ',' to separate multiple filters. |