Sunday, August 16, 2020

When to use Abstract Classes in C#?

 When we have a requirement where our base class should provide the default implementation of certain methods whereas other methods should be open to being overridden by child classes use abstract classes.

Friday, August 14, 2020

How can you detect the client's browser name?

 You can use the navigator. appName and navigator. userAgent properties.

C# Destructor Syntax

 class User

    {

        // Destructor

        ~User()

        {

            // your code

        }

    }

Thursday, August 13, 2020

visual studio component model cache clear

 %localappdata%\Microsoft\VisualStudio\ -- Goto 12.0 or particular visual studio 14.0 delete component cache model inside folders. 

Wednesday, August 12, 2020

What is the difference between struct and class in c#

 Difference between Structs and Classes 

Structs are value type whereas Classes are reference type. 

Structs are stored on the stack whereas Classes are stored on the heap. 

When you copy struct into another struct, a new copy of that struct gets created modified of one struct won't affect the value of the other struct.

Class can create a subclass that will inherit parent's properties and methods, whereas Structure does not support the inheritance. 

A class has all members private by default. 

A struct is a class where members are public by default. 

 Boxing and unboxing operations are used to convert between a struct type and object.

Friday, August 7, 2020

What are the return types in MVC?

Various Return Types From MVC Controller

System.Web.Mvc.ContentResult.

System.Web.Mvc.EmptyResult.

System.Web.Mvc.FileResult.

System.Web.Mvc.HttpStatusCodeResult.

System.Web.Mvc.JavaScriptResult.

System.Web.Mvc.JsonResult.

System.Web.Mvc.RedirectResult.

System.Web.Mvc.RedirectToRouteResult.

Why do we use MVC pattern?

 MVC is an acronym for Model, View, and Controller. It's a product development architecture. With the emerge of MVC approach, it helps you create applications that separate the different aspects of the application (input logic, business logic, and UI logic) while providing a loose coupling between these elements.

Is MVC a framework?

The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. MVC is one of the most frequently used industry-standard web development frameworks to create scalable and extensible projects.

Is MVC is a design pattern?

Model–view–controller (usually known as MVC) is a software design pattern commonly used for developing user interfaces that divide the related program logic into three interconnected elements.

What is design pattern with example?

 Design patterns provide a standard terminology and are specific to particular scenario. For example, a singleton design pattern signifies use of single object so all developers familiar with single design pattern will make use of single object and they can tell each other that program is following a singleton pattern.