The Dependency Injection provider of .NETCore, out-of-the-box, doesn't provide Interceptors, as we can find in other DI frameworks as Unity or Spring.
Code & Go
C# and Microsoft related technical articles
mercredi 28 août 2019
samedi 10 novembre 2018
C#: Filter method return using Generics and Interception
keywords: Linq, LambdaExpressions, AOP
This article is based on a very specific requirement I found once, I think the result was very nice and deserve the share with the public.
The problem is we are receiving a large amount of data that we don't need.
We can't filter data on source, the services implementation are out of our reach and don't provide the kind of filter we need.
This article is based on a very specific requirement I found once, I think the result was very nice and deserve the share with the public.
Requirement:
We have several service connectors retrieving data from external sources. Data is then used by business layer.The problem is we are receiving a large amount of data that we don't need.
We can't filter data on source, the services implementation are out of our reach and don't provide the kind of filter we need.
dimanche 24 septembre 2017
C#: Retry Actions and Func
I was in a need of a Retry logic for void Actions and boolean Func, and I wanted to avoid to carry on a full framework or nuget package for it.
dimanche 17 septembre 2017
C#: webApi cache, Etag and 304(NotModified) StatusCode [2/2]
part 2: The Demo
We have two ways (at least) to intercept requests on webapi before they arrive to controllers:
- MessageHandler: as CacheCow do.
- ActionFilterAttribute: I will use this.
dimanche 27 août 2017
C#: Logging method calls with AOP Interceptor ... without IOC in place
AOP (Aspect-oriented programming) is used to intercept processes on an application, ex: for intercept method's executions.
Main IOC framework provide a way to do that, but what if we don't have Dependency Injection in place and we want the interception behavior ?
dimanche 9 avril 2017
C#: webApi cache, Etag and 304(NotModified) StatusCode (1/2)
part 1: The Presentation
Some time ago I was assigned to a project to setup a WebApi (C#, .NET 4.5). This service should be exposing lot of data behind each resource, and clients will be requesting very often.One of the requirements was to avoid to send data back to clients when they already have the most recent version of it.
mercredi 8 mars 2017
Inscription à :
Articles (Atom)