Skip to content

Instantly share code, notes, and snippets.

View tnngo2's full-sized avatar

Chris Ngo tnngo2

View GitHub Profile
using System;
namespace Theory10
{
/// <summary>
/// Class ExtensionExample defines the extension method
/// </summary>
static class ExtensionExample
{
// Extension Method to convert the fist character to
using System;
namespace Theory10
{
class House
{
public string HouseName;
public int Members;
}
using System;
namespace Theory10
{
class Dynamic
{
static void Main(string[] args)
{
dynamic i = 1;
Console.WriteLine(i.GetType());
using System;
namespace Theory_9
{
class Salary
{
static void Main(string[] args)
{
double? actualValue = null;
double marketValue = actualValue ?? 0.0;
using System;
namespace Theory_9
{
class Numbers
{
static void Main(string[] args)
{
System.Nullable<int> numOne = 10;
System.Nullable<int> numTwo = null;
using System;
namespace Theory_9
{
class Employee
{
static void Main(string[] args)
{
int empId = 10;
string empName = "Patrick";
// StudentDetails.cs
partial class StudentDetails
{
public void Display()
{
Console.WriteLine("Student Roll Number: " + _rollNo);
Console.WriteLine("Student Name: " + _studName);
}
}
// StudentDetails1.cs
// MathsDemo.cs
partial interface IMathsDemo
{
int Addition(int valOne, int valTwo);
}
// MathsDemo2.cs
partial interface IMathsDemo
{
int Subtraction(int valOne, int valTwo);
}
using System;
namespace Theory_9
{
class Parameters
{
delegate void Display(string msg, int num);
static void Main(string[] args)
using System;
namespace Theory_9
{
class MultipleAnonymousMethods
{
private delegate void Display();
static void Main(string[] args)
{
Display objDisplay = delegate