nityaprakash's Blog

Dispose Vs Finalize

 17-Nov-2011   NityaPrakash     .NET  GC 

We have been using Dispose for many of the cases and we also know what dispose is, and what it is used for. Similarly Finalize method also used for same purpose. In this article I will try to explain what is dispose and Finalize. Where to use Finalize...

Read More

Event Based Asynchoronous Pattern

 18-Dec-2011   NityaPrakash     .NET  MultiThreading  EAP 

Sometime application need to perform long running tasks and yet it should be responsive.  Or we need to execute multiple task simultaneously to boost the performance of the application.  In window application BackgroundWorker...

Read More

Text Box With UnDoable Text Manipulation

 17-Jan-2012   NityaPrakash     Winform  Textbox 

TextBox is a very common control used in Winforms. Every window application always have this control. Recently I got chance to work with Textbox�s features other than common properties and methods. I am trying to consolidate what I learnt which is not...

Read More

On Demand Assembly Load - Part I

 05-Feb-2012   NityaPrakash     .NET  Assembly  AppDomain 

In this article I'll show you, how to load assembly dynamically on demand. Recently I worked on a project where I needed to load same assembly from different code base. Assemblies were located on different location as per the environment(dev/qa/uat/prod).


Read More

Managing Data in Session for Page Level Data

 18-Aug-2012   NityaPrakash     ASP.NET  SessionState 

Sometime, int web application we need to store data in session excessively. This data probably not related to the current user and not being used through out the application. It may be process specific or page specific. The question arise here that...

Read More

OnDemand Assemply Load - PartII

 08-Sep-2012   NityaPrakash     Assembly  RemoteObject 

In last article Part1, I tried to explain how can we load assembly on demand and unload.  In that article, we created object in another appDomain, but referenced and used in current domain.  But, after some time, when try to access that object,...

Read More

Delegate window event to ViewModel ICommand

 18-Mar-2013   NityaPrakash     WPF  ICommand 

In most of the cases we use MVVM pattern in WPF to build application. Main essence of MVVM pattern is View doesn�t know about ViewModel. View and ViewModal interact to each other through DataContext property...

Read More

Generate XmlDocument with XPathList

 28-Mar-2013   NityaPrakash     XML 

I spent almost a day to figure out the algorithm to generate the XML from my list of XPaths.  In our structure we were storing only XPath of leaf node. which was pointing to a data in other table.  We had to show this XPath in TreeView Control...

Read More

Hosting WCF Service by Using WAS

 03-Apr-2013   NityaPrakash     WAS  WCF 

The Windows Process Activation Service (WAS) extends the functionality of IIS by removing the dependency on the HTTP protocol.  Using WAS, we can host services in IIS that make use of other protocols, like TCP, named pipes and MSMQ.  WAS can...

Read More

Multi Threading - Part1

 28-May-2013   NityaPrakash     MultiThreading 

In this article, I will be revisiting the basic concepts of multi threading. I am going to talk about traditional old style thread creation and playing with ThreadPool. Thread is an independent execution path, that able to run simultaneously with...

Read More

Multi Threading - Part2

 28-May-2013   NityaPrakash     MultiThreading  ThreadPool 

Whenever we start a thread, a few hundred microseconds are spent organizing such things like fresh private local variable stack.  Each thread also consumes by default 1MB of memory.  The thread pool reduce these overheads by sharing and recycling...

Read More

Multi Threading - TPL

 02-Jun-2013   NityaPrakash     TPL  MultiThreading 

Prominently, a task is a lightweight object for managing a parallelizable unit of work.  A task avoids the overhead of starting a dedicated thread by using the CLR�s thread pool.  It is the same as we call ThreadPool.QueueUserWorkItem to start...

Read More

Manipulating Data in ADO-NET DataTable

 02-Apr-2014   nityaprakash     ADO.NET 

I have been using ADO.NET for long time and using quite often, as it is required to connect to database in .NET. However, I came across few features recently while studying. I haven't used them so far. I am sharing those features related data manipulations...

Read More

Code First database migration in Entity Framework

 06-Apr-2014   nityaprakash     EntityFramework 

This post explains how to do code first database migration works with Entity Framework. I like to work. There are some time require to group some set of entities and want to migrate separately. For example, I usually group User related...

Read More

Basic Parallel Programming

 19-Apr-2014   nityaprakash     TPL  ChildTask  ChildTask 

Parallel programming is now become a basic or can be said essential now days. Everywhere it is being used. It is time to Learn it properly and start using for faster task execution. Computers now more powerful and occupied with multi-core processor...

Read More

Canceling long running task

 26-Apr-2014   nityaprakash     TPL 

When long running task is under process, this is a good idea of providing cancellation feature. However it is bit odd but still a useful feature. For example in windows copy process is running in different thread but User Interface provide a feature...

Read More

Mapping DTO with Domain Object with AutoMapper

 09-Jun-2014   nityaprakash     AutoMapper 

Currently I am working on a project where data is being saved in database using Entity Framework. So I created a DataRepository project separately and created Data Entity Object within that project. Project was loosely coupled and Service using Interface...

Read More

Removing code first migration and degrade to older state

 28-Jul-2014   nityaprakash     EntityFramework  code-first-migration 

Yesterday I came across a scenario where I have added a new migration folder also updated migration with code first migration process. I did following thing...

Read More

User Friendly URL in ASP.NET WebForms

 24-Aug-2014   nityaprakash     ASP.NET  WebForm 

I haven't used user friendly urls (similar to MVC url) in asp.NET WebForms like (http://localhost:57570/Person/Edit/1). This might be a year and half old technology introduced with ASP.NET 4.0. Earlier it was used with NuGet package....

Read More

Basic Exception Handling in TPL

 25-Oct-2014   nityaprakash     TPL  Exception-Handling 

When a task throw exception it cannot be catch into main method. In earlier cases (before TPL) we had to handle exception in same method which being executed in separate thread. Handling exception in thread is as necessary as in main application. It...

Read More

Handling Multiple Exception in a Task

 29-Oct-2014   nityaprakash     TPL  Exception-Handling 

When we are expecting more than one exception in a set of task than we have Handle() delegate provided by AggregateException. We can provide our implementation to Handle method. This will be executed for each exception returned...

Read More

A potentially dangerous Request.Form value was detected from the client

 08-Nov-2014   nityaprakash     ASP.NET  Error 

I have been working this week on migration application from one webfarm infrastructure to another webfarm. Our application was earlier deployed in IIS6 based webfarm which in process of migration to IIS7 based webfarm. During this migration, I encountered...

Read More

User Bower As Package Maintenance and publishing tool

 20-Dec-2015   nityaprakash     packaging  publishing  bower  opensource 

Bower is a package maintenance and publishing tool for client side packages. It helps installing, uninstalling & updating the client side packages like bootstarp, jquery, angularJs, Jasmin etc. Managing client side library/packages are little cumbersome...

Read More

Subscriber and publisher implementation with WCF

 19-Mar-2017   nityaprakash     WCF  DuplexBinding 

This article explains how we can implement publisher and subscriber pattern in WCF. Why we need this pattern? Sometime, client send a request to server which invoke a process. This process is long running and client...

Read More

Callback Contract to Implement an Eventing Mechanism

 08-Apr-2017   nityaprakash     WCF  DuplexBinding 

In last article, I have describe how to implement publisher/subscribe pattern with duplex binding. Here, I am going to explain how to implement eventing...

Read More

Getting Started with Elasticsearch in .NET - Part 1

 09-Jul-2017   nityaprakash     ElasticSearch 

This post is explains about starting with Elasticsearch in .NET. It starts up with setting up the elastic search locally. Setting up Kibana to do locally to create regular tasks liken, creating indexes, understanding index creation, mapping (Schema),...

Read More

JWT Token based Authentication in ASP Net Core Web API

 11-Oct-2017   nityaprakash     ASPNETCORE  BEARER  TOKEN 

In this post, I am going to show how can we implement JWT Token base authentication in ASP.NET Core 2.0 Web API (REST API). There are slight change in ASP.NET Core 2.0 in creating JWT token from ASP.NET Core 2. I haven't work on ASP.NET Core 1.x in...

Read More

Using ASP NET Core 2 Identity with SQLITE

 17-Oct-2017   nityaprakash     ASPNETCORE  IDENTITY 

We are going to configure ASPNET membership with ASP.NET Core 2.0 Web API. ASPNET membership provide many inbuilt functionality to manger users in web applications, so we don't need to create our own membership functionality. We are going to to use...

Read More

Observable vs Subject vs Promise in Angular

 24-Aug-2018   nityaprakash     Angular  Angular4  Observable  promise  subjec 

In this Article we are going to discuss about Observables, Subject and Promises in the Angular. We are going to talk about, what is Observable, Subject and Promise in Angular. How should create observable and subject? How it is different/similar with...

Read More

Understanding Web API 2 Request Life cycle

 23-Nov-2018   nityaprakash     WebAPI  RESTful  life-cycle  Controller 

In this article I am going to explain how Web API 2.0 lifecycle works. This is the process by which Web API dispatches requests, which is the sequence of steps by which an incoming HttpRequestMessage object is processed to produce an HttpResponseMessage...

Read More

Customizing Dispatch Process in Web API 2

 30-Nov-2018   nityaprakash     WebAPI  life-cycle  Controller 

In previous article we tried to understand the dispatch process of Web API. we extend it to customize the same project. How are we going to add new message handler in th dispatch process. We are also going to learn, how can we replace...

Read More

All About Attribute-Based (Direct) Routing in Web API 2

 15-Dec-2018   nityaprakash     WebAPI  Routing 

In this post I am going to and direct aka attributes based routing. Routing is the first thing in the request which used to determine the controller and action from the request. In my previous article, I have mentioned that after HttpServer,...

Read More