From 9aa3b8dca1daf488004f9cae12b2661e09a17066 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Asl=C4=B1?= <36711782+asliyigiit@users.noreply.github.com>
Date: Thu, 21 Dec 2023 11:53:30 +0300
Subject: [PATCH] Update README.md
---
README.md | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 57c4121..efcc65d 100644
--- a/README.md
+++ b/README.md
@@ -49,17 +49,25 @@ To start using NexusAop in your .NET 5.0 project, follow these simple steps:
1. Install the Package:
` dotnet add package NexusAop `
-2. Apply Custom Attributes:
+2. Service Implementation:
+
+```csharp
+serviceCollection.AddSingletonWithCustomAop();
+```
+3. Apply Custom Attributes:
Decorate your methods with custom attributes to define the desired cross-cutting concerns.
```csharp
-[CustomAspect]
-public async Task MyMethodAsync()
+public class TestService : ITestService
{
- // Your method implementation
+ [CustomAspect]
+ public async Task MyMethodAsync()
+ {
+ // Your method implementation
+ }
}
```
-3. Integrate Aspect-Oriented Behavior:
+4. Integrate Aspect-Oriented Behavior:
Use the provided methods such as NextAsync() and ExecuteAndGetResultAsync() within your custom aspects to influence the method execution flow.
@@ -82,7 +90,7 @@ public class CustomAspectAttribute : NexusAopAttribute
}
}
```
-4. Build and Run:
+5. Build and Run:
Build your project, and NexusAop will seamlessly weave the specified aspects into your methods during runtime.
# Cache Attribute Example