Taswar Bhatti
The synonyms of software simplicity
Category: .NET

If you are using AWS S3 C# TransferUtilityUploadRequest and when you try to upload objects onto S3 you can potentially get Access Denied. The reason could your IAM Role is not defined to have access or your bucket name is incorrect. What do you mean bucket name is incorrect? Basically it boils down to that […]


If you are working on AWS Lambda Dotnet with C# and find out that you are getting something like an error like below. The main reason is that you most likely created the lambda on the console first and then tried to upload the code using dotnet cli e.g dotnet lambda deploy-function “functionName”. In order […]


In C#7 there is an enhancement in the main method Async Main in C# that will allow you to await in your main method. Let me show you an example of how it was in C#6 and then how it has changed in C#7. You will remember this most likely

One will need to […]


In C#7 there is an improvement on using out parameter. Some of you may remember writing code like below.

The improvement that C#7 brings is you can now declare out variables in the argument list of a method call, rather than writing a separate declaration statement like below:

And it doesn’t end there […]


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 […]


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

When using C#7 you can use Expression Bodied Accessors like below which makes the […]


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 […]


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 […]


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 […]


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? […]