Here is a tricky interview question: Please write output of following code and explain why? class Base : IDisposable { public Base() { Console.WriteLine(” Base Constructor”); } static Base() { Console.WriteLine(” Base Static Constructor”); } public void Dispose() { Console.WriteLine(” Base Dispose”); } ~Base() { Console.WriteLine(” Base Destructor”); } } class Derived : Base, IDisposable …
Month: March 2017
Linked List Implementation in C#
Linked List is an interesting topic that it is a special kind of list we can use. Reference: https://www.codeproject.com/Articles/1104980/Linked-List-Implementation-in-Csharp What is Linked List? Linked list is a linear data structure. It’s a collection of elements. Element is called as Node. Each element has value(data) and reference of next node. The very first node is called as Head and …
Customize the Password Rule in ASP.NET Identity
It is quite common that we need to customize out password rules in ASP.NET identity. The best way for this is to use our own PasswordValidator in ApplicationUserManager. By this way, everywhere we need to create a new password (new user registering or password changing), the validator will always be called and we can make the code consistent …