What Is Dependency Injection?

Dependency Injection Dependency Injection (DI) is a pattern to hold dependencies between class and also to create loosely coupled classes. Before explaining, what are loosely coupled let’s understand tightly coupled classes. For example, there are two classes ClassA and ClassB defined as bonding between them. See the code as ClassA associated with ClassB So ClassB accessible or connected to ClassA…

Continue Reading

Execute Web Page Using Task Scheduler

Sometimes you have to create console application or window services to run based on schedule time and you just need to use Task Scheduler and set your time and it will be run automatically. It is easy to schedule console application or windows service with stand alone logic to run individually to access database or other services and do whatever…

Continue Reading

Send Bulk Emails Using Multi-Threading in .Net

If you use simple method call in for each loop to send bulk emails, for example, 1000 emails then you have been stuck in your application because of a single thread operated to send emails which are currently using the resources and thread of the application so to get the benefit of multi-threading is possible in .Net. To use multi-threading…

Continue Reading

Send Email Asynchronously in .Net

If you use synchronous mode to send an email then the process for to sending email start by calling a method, then the application has to wait to complete and that time application is blocked or halted. In contrast, asynchronous mode to call the method that you define as background and that method, return to an application immediately no matter…

Continue Reading

DateTime conversion and Snippets in MSSQL

Below you can find snippets for SQL to get data for different parts of date and time and all below queries tested in MS SQL server. DateTime Conversions MSSQL string to datetime conversion DateTime Snippets Year First day of this year First day of previous year Last day of previous year Last day of this year First day of next…

Continue Reading