Dotnet, DotnetCore, Azure, C#,VB.net, Sql Server, WCF, MVC ,Linq, Javascript and Jquery
21 February 2016
7 February 2016
Application pools in IIS
- Improved server and application performance. You can assign resource-intensive applications to their own application pools so that the performance of other applications does not decrease.
- Improved application availability. If an application in one application pool fails, applications in other application pools are not affected.
- Improved security. By isolating applications, you reduce the chance that one application will access the resources of another application.
29 October 2015
Database currently using by Market leader
Google - Bigtable
LinkedIn.com -
Oracle (Relational Database)MySQL (Relational Database
Stack Overflow - SQL Server.
Flickr uses MySQL.
YouTube uses MySQL but they are moving to Google's BigTable.
Myspace uses SQL Server.
Wikipedia uses MySQL.
Facebook.com
Hive (Data warehouse for Hadoop, supports tables and a variant of SQL called hiveQL). Used for "simple summarization jobs, business intelligence and machine learning and many other applications"
Cassandra (Multi-dimensional, distributed key-value store). Currently used for Facebook's private messaging.
28 June 2015
POST vs PUT in Rest
Ajax call in MVC
The first thing to look at is the key settings options that are available for AJAX requests:
type This is type of HTTP Request and accepts a valid HTTP verb. POST is the option illustrated in this article.
url This is the location of the resource that the request will be made to.
data This is the actual data to be sent as part of the request.
contentType This is the content type of the request you are making. The default is 'application/x-www-form-urlencoded'.
dataType This is the type of data you expect to receive back. Accepted values are text, xml, json, script, html jsonp. If you do not provide a value, jQuery will examine the MIME type of the response and base its decision on that.
Example
< script >
$( function () {
$( "button" ).click( function () {
var car = { Make: 'Audi', Model: 'A4 Avant', Colour: 'Black', Registered: 2013 };
$.ajax( {
type: "POST",
url: "/Receiver",
data: car,
datatype: "html",
success: function ( data ) {
$( '#result' ).html( data );
}
} );
});
} );
< /script >
Setting async false in ajax in MVC
Setting async to false means that the statement you are calling has to complete before the next statement in your function can be called. If you set async: true then that statement will begin it's execution and the next statement will be called regardless of whether the async statement has completed yet.
$( function () {
$( "button" ).click( function () {
var car = { Make: 'Audi', Model: 'A4 Avant', Colour: 'Black', Registered: 2013 };
$.ajax( {
type: "POST",
url: "/Receiver",
data: car,
async:false,
datatype: "html",
success: function ( data ) {
$( '#result' ).html( data );
}
} );
} );
} );
By default async is true in ajax call.
MVC Life Cycle
Step 1 Fill route: - MVC requests are mapped to route tables which in turn specify which controller and action to be invoked. So if the request is the first request the first thing is to fill the route table with routes collection. This filling of route table happens in the global.asax file.
Step 2 Fetch route:- Depending on the URL sent "UrlRoutingModule" searches the route table to create "RouteData" object which has the details of which controller and action to invoke.
Step 3 Request context created: - The "RouteData" object is used to create the "RequestContext" object.
Step 4 Controller instance created: - This request object is sent to "MvcHandler" instance to create the controller class instance. Once the controller class object is created it calls the "Execute" method of the controller class.
Creating Response object: - This phase has two steps executing the action and finally sending the response as a result to the view.
Step 5 Execute Action: - The "ControllerActionInvoker" determines which action to executed and executes the action.
Step 6 Result sent: - The action method executes and creates the type of result which can be a view result , file result , JSON result etc.
Implementing OAuth validation in a Web API
I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...
-
ViewBag, ViewData, TempData and View State in MVC ASP.NET MVC offers us three options ViewData, ViewBag and TempData for passing data from...
-
// Export Datatable to Excel in C# Windows application using System; using System.Data; using System.IO; using System.Windows.Forms; ...