Latest Posts

While working on .NET Core 3.1, started getting following error :-

Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.3' has a package type 'DotnetCliTool' that is not supported by project

continue...

Recently, one of my very old project which was working in old version of IBatis ORM comes under scanner when more than 10 transactions were passwed to it and it failed. Reason, it ws trying to hit db synchronously in a for loop to hit the DB and insert the new transaction one by one. For smaller set of transactions (<10) it was working fine but when the transaction increased, it went timed out. What I did to fix the issue to support any number of transactions is to do the trasansactions multi-threaded way. Below are the step by step details which I took and issue was resolved.

continue...

continue...

Delegates and Events in C#


Delegates and Events in C# .NET. Simple example, self explainatory code with comments inline. Lets check it out in code behind.

 

continue...

The repository and unit of work patterns are used to create an abstract layer between data access layer 

and the business logic layer. This can help to insulate application from changes in data store and also help in test-driven-development (TDD).

In this post, I have implemented a repository class for entity type "User" creating a repository interface and a repository class.

When we instatiate the repository in the controller, the interface will accept a reference to the object that implements the repository interface.

1. When the controller runs under web server, it receives a repository that works the Entity Framework.

2. When the controller runs under a unit test class, it receives a repository that works with either in-memory data or a mocking database which can be easily manipulated for testing.

The unit of work class wraps the work of multiple repositories by creating a single database context class shared by all.

continue...