Week 01: Murtaza Munawar Fazal
Week 01: Murtaza Munawar Fazal
▪ Assignment # 2 and
onwards:
▪ If plagiarism is found then 0
for entire assignment.
▪ Reference Books
▪ Pro C# 7 With .Net and .Net
Core by Andrew Troelsen and
Philip Japikse (Apress
Publications)
▪ You should have sound
knowledge of programming
▪ You should have sound
knowledge of data structures
▪ You should have sound
knowledge of database server
and writing queries
▪ Visual Studio (VS 2017)
▪ Windows Application
▪ Windows Service
▪ Web Application (ASP.Net)
▪ Web Service (ASMX)
▪ WCF
▪ WEB API
▪ Example:
▪ Choosing Sorting Algorithm
▪ Choosing Data Base , choosing types of join
▪ Choosing different Web Service v/s WCF v/s Web API
OVERVIEW
VB C++ C# JScript …
Visual Studio.NET
ASP.NET: Web Services Windows
And Web Forms forms
JIT Compiler
Native Code
▪ class Calc
{
public int Add(int x, int y)
{
return x + y;
}
}
▪ Single inheritance
▪ Multiple interface implementation
▪ Static and instance members
▪ Nested types
▪ Member access
▪ Public, protected, internal, private, internal-protected, private-
protected
▪ Interfaces are nothing more than a named collection of abstract
member definitions, which may be supported (i.e.,
implemented) by a given class or structure.
▪ In C#, interface types are defined using the interface keyword.
▪ By convention, all .NET interfaces begin with a capital letter I,
as in the following example:
int i = 123;
string s = "Hello world";
i 123
s "Hello world"
TYPE SYSTEM
▪ Value types
▪ Primitives int i;
▪ Enums enum State { Off, On }
▪ Structs struct Point { int x, y; }
▪ Reference types
▪ Classes class Foo: Bar, IFoo {...}
▪ Interfaces interface IFoo: IBar {...}
▪ Arrays string[] a = new string[10];
▪ Delegates delegate void Empty();
PREDEFINED TYPES
▪ C# predefined types
▪ Reference object, string
▪ Signed sbyte, short, int, long
▪ Unsigned byte, ushort, uint, ulong
▪ Character char
▪ Floating-point float, double, decimal
▪ Logical bool
▪ Predefined types are simply aliases for system-provided types
▪ For example, int = System.Int32
UNIFIED TYPE SYSTEM
▪ Boxing
▪ Allocates box, copies value into it
▪ Unboxing
▪ Checks type of box, copies value out
int i = 123;
object o = i;
int j = (int)o;
i 123
o System.Int32
123
j 123
ATTRIBUTES
▪ Attributes can be
▪ Attached to types and members
▪ Examined at run-time using reflection
▪ Completely extensible
▪ Simply a class that inherits from System.Attribute
▪ Type-safe
▪ Arguments checked at compile-time