Posts

Showing posts from 2018

What is ngModel in Angular?

ngModel provides us the mechanism to sync input data/data from any source (like Web API, Database) from HTML control element to the component class. Understand this in the very easy way: Suppose you have a user class named with User as following: export class User { id : number ; email : string ; constructor ( values : Object = {}) { //Constructor initialization Object . assign ( this , values ); } } And in HTML, you have a textbox for binding email property of the user class. For simplicity, we will call User class to "U" and textbox control to "T".  So here are the following definitions: ngModel provides the way of binding data from U to T and/or vice-versa. [ngModel]="user.email" is the syntax for one-way binding, while, [(ngModel)]="user.email" is for two-way binding, and the syntax is compound from [ngModel]="user.email" and (ngModelChan...

What is Inheritance in C# .Net ?

Inheritance: Inheritance is the strong concept of the world of object-oriented programing. In a Simple word, The mechanism of accessing or extending the behavior or properties of an existing class is known as Inheritance. For an example, If a class has methods let say Add(int s, int n) and its added two given values. So if we are going to create any class and we want to create an Add function of two variable then why we create it from scratch if this is available in an existing class. Yes, We can use the Add function of existing class in a new class as below: public class ExistingClass {    public int Add(int s, int n)    {       return s+n;    } } and the new class is: public class NewClass : ExistingClass {    base.Add(110,210); // this will call the existing methods }

What is Object in C# ?

An object is a real-time entity by which a class comes into existence. Without creating the object we can not use the class. For Example: public class MyClass {    int x=10;   public void MyFunction()   {      Console.WriteLine(x.ToString());    } } If we want to use the MyClass's MyFunction in another class then we have to create an object of MyClass in another class like below: public class MyOtherClass { //  Here we want to use the MyFunction of MyClass the create an object of this.     MyClass obj=new MyClass(); // By this line of code object will be created and stored as "obj".    //Now by the help of this "obj" we can call the MyFunction(); as below.    obj.MyFucntion(); } Output: 10. What is Inheritance in C# .Net ?

What is Class in C# ?

In Opps/C# everything written in a class, unlike procedural language C. So a class is a template, block, unit or blueprint that contains the data member (variable/properties) and its member functions.  A class must be defined by a keyword "class". public class MyClass {     int x=10;  // Data member;       public void MyFunction(); // Member Function;   } What is Object in C# ?

What is difference between Project Application and Web Application in .Net ?

Image
As you can see in the above pic there is two type of option Visual Studio provide us to develop any application. So what is the difference between them?. Project: When we choose Project option for our application then that means: The project will be compiled and run by Visual Studio only. The project can be divided into multiple subprojects so that multiple developers can work simultaneously and later on these project can be merged into the single project. Every subproject will have its dlls. When we publish any project the published bin folder contains individual dlls for all subprojects. Web Site: When we choose the Web Site option for our application then that means: The project will be compiled by Visual Studio and run by VS as well as by IIS if you configure the virtual directory. The project cannot be divided into multiple subprojects. If you have taken the references of others project then after publishing that website will create only one dll fo...

What is difference between var and dynamics ?

In simple and one line answer is, var is statically typed where dynamic is not. Let me explain when you declared like var x="subhan"; Then compiler understands x as a string at compile time and if you try to divide this x by any integer value suppose 10 then it will show you the compile-time error because the type of x has been decided at compile time. In another hand if you declare any variable using dynamic like dynamic y="subhan"; this will be accepted at compile time but runtime it will show error. What is difference between Project Application and Web Application in .Net ?

What is the Manifest in .Net ?

In one of my previous articles, I have explained that what is metadata (information about any classes is known metadata). When a metadata created for any classes the information about this metadata itself stored somewhere in .Net like:  Version  Security Type of metadata etc. Above information is very important for any assembly/dll while we reference it for further use in our project. So in simple term, the data about metadata is known as manifest in .net What is difference between var and dynamics ?

What is assembly in .Net ?

Assembly is the location where all inbuilt library DLLs resides . When we create any program in .Net and suppose we need to access any namespace/classes in our program then we have to add reference of dll of that namespace first. These dll exists in the assembly location of .Net. What is the Manifest in .Net ?

What is Reflection in .Net Framework ?

Let me make it very easy to understand you what is a reflection. So if we talk about the " class " in oops then what comes into your mind? I hope you will say ohh class means a unit in which we declare some data member (like int, string etc.) and it's member functions (like any function). Cool :-) that's right. So the classes which you and/or your colleague developer develop can be seen it's metadata (data members and member functions) because you have its code file in the projects itself. But the classes that is not developed by you and your colleague developer and you have only it's .dll then how you can know it's data members and members functions. Exactly, reflection can tell you this. So, Reflection provide you facility to retrieve meta data of any inbuilt classes. What is assembly in .Net ?

What is CTS in .Net Framework ?

CTS stands for Common Type System. In the world of programming, Type of anything plays the key role that is directly proportioned to the memory. Types like int, string, array or others take its own memory when the program executes. So this becomes more important to pick any data type smartly so that unnecessary memory uses can be reduced. So when any programme run/execute (by CLR) the CTS ensure that what will be the type and its memory allocation algorithm should follow in order to execute any program efficiently. CTS play the key role for interoperability of two or more than two languages. What is Reflection in .Net Framework ?

What is CLS in .Net Framework ?

CLS stands for Common Language Specification. CLR (Common Language Runtime) uses some rules/specification at runtime so that two or more languages can become interoperable. The Rules that are written into the .Net framework so that all language should follow that rules or specification. The rules or specification known as CLS (Common Language Specification).

What is CLR in .Net Framework ?

There are some important components that have the key role in the process of developing any project to executing it for the final result. What is CLR? CLR stands for Common Language Runtime. Let me explain it a little bit easier: As we knows.Net Framework has multiple languages by which we can create an application and we can use one application (Library) created in J# into another application created in another language let say C#. So in the above scenario, we should have one question in our mind that how these two applications can communicate with each other even languages are different. That means there is something in .Net Framework which makes these two languages interoperable (understandable). To become two or more languages interoperable with each other they should understand their types and specification (rules). At runtime, CLR provides this facility so that two or more application developed in multiple languages can be interoperable. Wha...

What type of application can be develop using Microsoft .Net Framework ?

We can develop many types of application using .Net Framework some of them as below: Console Application Window Application Web Application Web Services and much more. What is CLR in .Net Framework ?

How many languages does .Net Framework support ?

.Net Framework support about 22 to 23 languages. Some of them are as below: C# Vb J# C Ada APL Perl Python COBOL Java Haskell Pascal ML Scheme Mercury RPG Oberon SmallTalk Oz Eiffel Jscript Camlto What type of application can be develop using Microsoft .Net Framework ?

What is Microsoft .Net Framework ?

Framework: A framework contains some inbuilt library or classes to help the developer to develop the new programme. The most important thing of any framework is that how that framework parses the source code to its final execution. this parser is known as Compiler that makes sure the code written by any developer is up to the standard of that framework. Now let talk about the .Net framework: .Net Framework: .Net Framework is like any framework that helps to build and run an application. .Net Framework provides an environment to develop an application using multiple languages like C#, Vb.net, J# etc under on framework. All languages become interoperable due to its huge library that contains the definitions (specification) for all languages. Note: Every language has its own Compiler to understand its structure. How many languages does .Net Framework support ?