Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CustomerOrders
{
class Program
{
static void Main(string[] args)
{
Items it = Items.getItem(); //here we are using items.getitem to get the method
Console.WriteLine("Name for item is: {0} and item id is {1}", it.itemname, it.itemid);
Console.ReadKey();
}
}
}Items.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CustomerOrders
{
class Items
{
public int itemid { get; set; }
public string itemname { get; set; }
public static Items getItem()
{
var newitem = new Items() { itemid = 101, itemname = "Ujjwal Patel" };
return newitem;
}
}
}