Skip to content

Instantly share code, notes, and snippets.

@Tesla9527
Created September 16, 2015 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tesla9527/73a0011c756b57b87174 to your computer and use it in GitHub Desktop.
Save Tesla9527/73a0011c756b57b87174 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public struct Customer
{
private int _id;
private string _name;
public int Id
{
get { return _id; }
set { _id = value; }
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public Customer(int Id, string Name)
{
this._id = Id;
this._name = Name;
}
public void PrintDetails()
{
Console.WriteLine("Id = {0} && Name = {1}", this._id, this._name);
}
}
class Program
{
static void Main(string[] args)
{
Customer C1 = new Customer(101, "Tesla");
C1.PrintDetails();
Customer C2 = new Customer();
C2.Id = 102;
C2.Name = "Michael";
C2.PrintDetails();
Customer C3 = new Customer
{
Id = 103,
Name = "Timi"
};
C3.PrintDetails();
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment