Logging and Tracing in Asp.Net MVC

Here, I am explaining the format of logs and tracing files in more readable form using Log4Net. Web config <!–Logging with Log4net –> <configSections> <section name=”log4net” type=”log4net.Config.Log4NetConfigurationSectionHandler, log4net” /> </configSections> <!–Logging with Log4net –> <!–LogFile Settings(Log4net): START –> <log4net> <!–Implementation Of FileAppender Starts Here!!–> <appender name=”LogFileAppender” type=”log4net.Appender.FileAppender”> <param name=”File” type=”log4net.Util.PatternString” value=”ErrorLogs\\ErrorLog_%date{yyyy-MM-dd}.log” /> <param name=”AppendToFile” value=”true” […]

Read More

Multiple Result Sets from database in Entity Framework

Stored Procedures with Multiple Result Sets Sometimes when using stored procedures you will need to return more than one result set. This scenario is commonly used to reduce the number of database round trips required to compose a single screen. Prior to EF5, Entity Framework would allow the stored procedure to be called but would only […]

Read More

Difference between Soap and Rest web service

Soap: It stands for Simple Object Access Protocol. It is a protocol. It uses HTTP and SMTP transport protocol. It supports only XML format. Using HTTP, SOAP model can tunnel to across firewalls and proxies without any modification to the SOAP protocol. It is more secure as compare to REST because it uses own security model. It supports WS-Security and ACID […]

Read More

Find the most frequent element in an Array

In this post, i will show you how to find the most frequent element in an array without using any inbuilt function . Example: class Program { static void Main(string[] args) { int j, maxCount, maxElement = 0, count = 0; maxCount = 0; //Take input numbers from user Console.WriteLine(“\n Enter 10 Numbers : “); […]

Read More

Different ways of injecting dependency in an AngularJS Application

When you start learning the very first characteristics of AngularJS, you may come across something called Dependency Injection (DI): the premise that AngularJS injects dependencies whenever an application needs them. As a developer, our task is only to pass the dependency to the module and everything else will be taken care by AngularJS. To create […]

Read More

Creating Unit Tests for ASP.NET MVC Controllers

In this blog post, we will learn to write unit tests for various MVC controller’s behaviors, such as view’s return types, redirecting to different actions etc. Specifically, we’ll cover writing Unit Tests for: ViewData of the Controller TempData of the Controller ViewBag of the Controller View of the Controller Let’s get started! Creating the MVC […]

Read More

What is the difference between layers and tiers

Layers: Layers refer to logical seperation of code. Logical layers help you organise your code better. For example an application can have the following layers. 1)Presentation Layer or UI Layer 2)Business Layer or Business Logic Layer 3)Data Access Layer or Data Layer The aboove three layers reside in their own projects, may be 3 projects […]

Read More

What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

Summary of important behavior differences: dependencies are installed on both: npm install from a directory that contains package.json npm install $package on any other directory devDependencies are: also installed on npm install on a directory that contains package.json, unless you pass the –production flag (go upvote Gayan Charith’s answer). not installed on npm install “$package” […]

Read More