DEV Community

Cover image for Interfaces are so yesterday in C# 12
Bug & Fix
Bug & Fix

Posted on

Interfaces are so yesterday in C# 12

It seems creating Interface is so yesterday in C# 12!

Please do not be shocked because I am going to dispute what most of you/us have done so far!.

I am going to say: Interfaces are not necessary in C# anymore!.

Huh ?.

How dare you?!

Wait and see ...

If you look at the Solution that I have created, I have no interface at ALL, but it works fine!

Image description

You might want to dispute my idea and ask then how can you write the test?. We are supposed to be discounted from the real database, but be able to write tests, then how can you do that?. I will tell you, I am not going to use any Mocking framework as well! Then how ?.

The answer is using Interceptors which I am going to use and explain in the next article in detail.

Top comments (0)