Monday, 30 September 2013

virtual (C# Reference).

The virtual keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class. For example, this method can be overridden by any class that inherits it:
public virtual double Area() 
    return x * y;
The implementation of a virtual member can be changed by an overriding member in a derived class. For more information about how to use the virtual keyword, seeVersioning with the Override and New Keywords (C# Programming Guide) and Knowing When to Use Override and New Keywords (C# Programming Guide).

When a virtual method is invoked, the run-time type of the object is checked for an overriding member. The overriding member in the most derived class is called, which might be the original member, if no derived class has overridden the member.
By default, methods are non-virtual. You cannot override a non-virtual method.
You cannot use the virtual modifier with the staticabstract, private, or override modifiers. The following example shows a virtual property:
class MyBaseClass
    // virtual auto-implemented property. Overrides can only 
    // provide specialized behavior if they implement get and set accessors. 
    public virtual string Name { get; set; }

    // ordinary virtual property with backing field 
    private int num;
    public virtual int Number
        get { return num; }
        set { num = value; }

class MyDerivedClass : MyBaseClass
    private string name;

   // Override auto-implemented property with ordinary property 
   // to provide specialized accessor behavior. 
    public override string Name
            return name;
            if (value != String.Empty)
                name = value;
                name = "Unknown";


Wednesday, 5 June 2013

Jqgrid with mvc is just awesome ..

Please follow the below link for download sample application in mvc 
this is just easy to implement with rich functionality inside ... this boom must try

demo page link ..

download link . 

Thursday, 28 March 2013

Asp.Net Mvc With Web Api

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. With WebAPI content negotiation, one can return data based on the client requests. What I mean is, if the client is requesting the data to be returned as JSON or XML, the WebAPI framework deals with the request type and returns the data appropriately based on the media type. By default WebAPI provides JSON and XML based responses.

WebAPI is an ideal platform for building pure HTTP based services where the request and response happens with HTTP protocol. The client can make a GET, PUT, POST, and DELETE request and get the WebAPI response appropriately.

In Summary, the WebAPI is

- An HTTP Service

- Designed for broad reach

- Uses HTTP as an Application protocol, not a transport protocol

Web API Architecture .

We shall see below the Web API architecture when you are hosting the WebAPI in ASP.NET and self-hosting through console or windows service.

Follow this link  for the detail article ....