Tag: C#

Check for palindrome in c#

Palindrome. Palindromes can be read in both directions. A palindrome has the same letters on both ends of the string. using System; namespace Demo { public class Program { /// /// […]

Implement Repository pattern in .Net

   The intention of this post is to explain about the Repository pattern and how its useful in enterprise applications. Introduction Why use Repository Misconceptions Implementation Conclusion Source Code Introduction The repository […]

Exception handling interview questions and answers

Can we use multiple finally blocks inside the method? Yes, you can write the multiple finally block inside the method. For every try block, you can have finally. try { […]

ASP.NET interview questions and answers

Which is the parent class of the Web server control? The System.Web.Ul.Control class is the parent class for all Web server controls. In which event are the controls fully loaded? […]

Download/Upload files using FTP in C#

        What is FTP?  FTP(File transfer protocol)  is a client-server protocol that relies on two communications channels between client and server: a command channel for controlling the […]

Swap two variable without using the third variable

using System; namespace Swap { class Program { private static void Main(string[] args) { int a = 1000; int b = 999; Console.WriteLine(“Before Swap”); Console.WriteLine(“Value of A :{0} “, a); […]

Solid Principles of OOP

Object oriented programming has 5 basic rules that we called solid rules where s stands for Single Responsibility Principle,o stand for Open Close principle,l stand for Liskov Substitution Principle,I stand […]

Singleton thread-safe class in c#

Introduction The singleton pattern is one of the best-known patterns in software engineering. Essentially, a singleton is a class which only allows a single instance of itself to be created, […]