Taswar Bhatti
The synonyms of software simplicity
Category: .NET
Csharp-MS-Dotnet

In C# 7 there the new feature called Local functions in C#. Basically Local functions allow one to write a function within the body of another method or function. It comes in handly in the case lets say you are creating a helper function that are mostly just used in one class or where the […]

Csharp-MS-Dotnet

In C# 7 there are Expression Bodied Accessors which allows you to write getter and setters somewhat more functional way, somewhat lambda’ish. Let me show you an example. You may remember the old way of writing getter and setters like below. Pre Expression Bodied Accessors Getter and Setter

Expression Bodied Accessors in C# 7 […]

Csharp-MS-Dotnet

In C#7 there are Digit Separators and Binary Literals which were added. One may wonder what these are? Basically you can replace long number values with underscore (_) such that code readability is improved. Let me give you couple of examples of it to make it clear.

Neat but it doesn’t end there you […]

Csharp-MS-Dotnet

So one may ask “What is the advantage of using discards in C#?”, and if you don’t know what discards are you can check out the MS C#7 Documentation about it. Basically discards are variables in simple terms, and the declaration of the variable as a discard is by assigning it the underscore (_) as […]

Csharp-MS-Dotnet

Some may wonder what is the difference between ValueTuple and Tuple that was released in C# 7, and you might say I have been using Tuples for a while now. Whats the difference? Some of you will remember with code like below that showcase the use of ValueTuple since .NET Framework 4.7

In order […]

Csharp_Pkcs11_Interop_Encryption_Decryption

I wanted to blog about using C# with pkcs11 on SafeNet ProtectServer HSM for your encryption need. The library I intent to use is the Pkcs11 Interop library on GitHub. To being with we need to understand what an HSM is? In wikipedia we find this definition. So how does an HSM really look like? […]

codeaholics-hongkong

I had the opportunity to speak in my native home Hong Kong for the first time when I was visiting for holidays on Cloud Design Patterns. It was a lot of fun and thanks to Codeaholics for holding the meetup group in such great form in Hong Kong. For people who wish to see my […]

csharp-dpapi-registry

This would be the second part of the blog post where we used powershell to store some secure data into our registry and have used DPAPI to encrypt the data. I wanted to cover how I would read the data back from the registry in my C# application. An example of C# using DPAPI to […]

Retry-Pattern-using-Polly-in-Csharp

One of the easiest cloud design pattern that one can try out is the Retry Pattern. I wanted to show how to use an Retry Pattern using Polly in C# as a example. So what does the Retry Pattern achieves? Problem Statement – What is the issue the pattern solves? When building applications you always […]

X509_certficiate_serial_with_Csharp_or_Python

In this blog post I wanted to show how one can use C# or Python to view the serial numbers of a X509 certificate. The serial number can be used to identify the certificate that one plans to use in their C# application, lets say for mutual authentication to another service. Why use X509 Certificates […]

UA-4524639-2