Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sholtee committed Dec 28, 2023
1 parent dc830d5 commit c6b2cfe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
41 changes: 31 additions & 10 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,45 @@ This library currently supports generating [proxies](https://en.wikipedia.org/wi
```
3. Enjoy

Note that the *target* can access its most outer enclosing proxy. To achieve this it just has to implement the `IProxyAccess<IMyInterface>` interface:
```csharp
using Solti.Utils.Proxy;
Remarks:
- The *target* can access its most outer enclosing proxy. To achieve this it just has to implement the `IProxyAccess<IMyInterface>` interface:
```csharp
using Solti.Utils.Proxy;

public class MyClass : IMyInterface, IProxyAccess<IMyInterface>
{
...
public IMyInterface Proxy { get; set; }
}
```
public class MyClass : IMyInterface, IProxyAccess<IMyInterface>
{
...
public IMyInterface Proxy { get; set; }
}
```
- Starting from v9.1 partial interface implementations are also supported:
```csharp
using Solti.Utils.Proxy;

public interface IMyInterface
{
void Intercepted();
void NotInterceptred();
}

public class MyInterceptor: InterfaceInterceptor<IMyInterface>
{
public void NotInterceptred() {...}

// will be triggered by Intercepted() only as NotInterceptred() has it's own implementation
public override object Invoke(InvocationContext context) {...}

...
}
```

For further usage examples see [this](https://github.com/Sholtee/proxygen/blob/master/TEST/ProxyGen.Tests/Generators/ProxyGenerator.cs ) or [that](https://github.com/Sholtee/injector#decorating-services ).
### To create ducks:
1. Declare an interface that covers all the desired members of the target class:
```csharp
public class TargetClass // does not implement IDuck
{
public void Foo(){...}
public void Foo() {...}
}
...
public interface IDuck
Expand Down
2 changes: 1 addition & 1 deletion SRC/ProxyGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Authors>Denes Solti</Authors>
<Version>9.0.0</Version>
<Version>9.1.0</Version>
<Version Condition="'$(Variant)' == 'ROSLYN_LEGACY'">$(Version)-RoslynV3</Version>
<AssemblyName>Solti.Utils.Proxy</AssemblyName>
<RootNamespace>Solti.Utils.Proxy</RootNamespace>
Expand Down
4 changes: 3 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,6 @@
- 9.0.0:
- *improved:* Cancellation in `asnyc` `Generator` methods
- *done:* Tested against `net8.0`, related fixes
- *breaking:* `Generator`s are demoted to `class`
- *breaking:* `Generator`s are demoted to `class`
- 9.1.0:
- *introduced:* Partial interface implementation support

0 comments on commit c6b2cfe

Please sign in to comment.