Posts

Software Architecture - Beginner

I was reading the articles about the technical architecture role and responsibilities and found some interesting pieces of information so thought to share with you all.  In this post, I will try to capture some of the techniques and terms commonly use in software architect and ask in interview. 1.        SOLID Principals a.        Single Responsibility Principal – Class should have only one responsibility. b.       Open Closed Principal – Open for extension but closed for modification. c.       Liskov Substitution Principal – Covariance and Contarvariance. d.       Interface Segregation Principal – Client should never be forced to implement the interface that it doesn’t use e.       Dependency Inversion Principal – Entities must depend on abstraction not on concretions. 2.        CAP Theorem – It’s a concept that ...

Display Loading/Wait image on Long Process using jQuery

If you are planning to display a logging image on a time consuming task on a web page then this post will help you in doing this. You can make this happen only by following below simple steps Step 1 CSS     .overlay {     background: #e9e9e9;       display: none;             position: absolute;        top: 0;                       right: 0;                     bottom: 0;     left: 0;     opacity: 0.5;     }   #loading-img {     background: url(../Images/Loading.gif) center center no-repeat;/*Add the loading image that you want to show*/     height: 100%;  ...

SSIS Merge Join - Both inputs of the transformation must contain at least one sorted column, and those columns must have matching metadata SSIS

Image
SSIS Merge Join Issue ( Both inputs of the transformation must contain at least one sorted column, and those columns must have matching metadata SSIS )   I was working on one of my client requirement where I need to split the flat file data based on the conditions and then add join that data with reference data (again a flat file). I used the MergeJoin task to achieve this. Unfortunately I ended up with this error. I tried most of the options available on the internet but none of them worked for me because my mistake was silly I set a property of “Sort” task in one not the other. That’s why MergeJoin was throwing “ Both inputs of the transformation must contain at least one sorted column, and those columns must have matching metadata SSIS ” error.     Lets first discuss about the solution of my problem Root Cause – The main problem was related to the Sort task. I selected the “Comparison Flags” option in one Sort task but not in other task because of that M...

Enable Basic Authentication in WevApi

Image
There are various ways to authenticate a request in WebApi but in this post I am going to talk about how to implement basic authentication in WebApi. The primary purpose of these authentication mechanism is to validate the incoming request. In basic authentication user credentials are hooked-up inside request and you can find it under the authorization header. If you are using third party token base services like oAuth2 to validate the request then these services are also uses the same basic authentication mechanism to validate the user before sharing the token with them. Lets get started Step 1- Create an attribute class and inherits the members of AuthorizeAttribute attribute class. The reason of inheritance is to override the “IsAuthorized” method. public class AuthorizeUser : AuthorizeAttribute     { protected override bool IsAuthorized( HttpActionContext actionContext)         {   }   ...

Add Basic Authentication to ajax request

In this post, I am going to explain how to pass the user credentials to a service that is enabled with basic authentication. In demo example, I have used the ajax jQuery request to connect to a service that validates user based on the credentials that we send in authentication header, if user successfully validated then it will return the data in JSON format and that data will get displayed on webpage in tabular format. If you are interested in getting to know how to enable basic authentication in MVC application, you can refer my this blog. Lets get started Step 1 CDN for   jQuery ,  jQuery min   Step 2 – HTML Code – in this example < table id ="tblProcess">                     < tr >                         < th > Process I...

Add log4net in .Net Application

log4net library If you are planning to use the log4net library for error/info/warning logging in your .net project then this post will help you in that. This post will give you the step by step process to setup and use the log4net library. I have used a slightly different approach to consume the basic methods of log4net.  Instead of creating a static variable of log4net interface, I created a sealed class and inside that created different methods to log the information. I have used the .net framework 4.5 to take the advantages of CompilerServices. If you don’t know about the CompilerServices refer this link . Furthermore, this article is going to explain you how to log the messages in flat file, database logging and sending the log information via email. Lets get started Step 1 – Prerequisite                 Download the latest version of log4net. Or use the neget manager to add the refere...