Wednesday, 25 October 2017

Delegates in c#





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace deletegate_salman

{

    class Program

    {

        public delegate void print(int num);

        static void Main(string[] args)

        {

            print p = printsalary;

            p(50000);

            p(450000);



            p = printeMPLOYEEID;

            p(50000);

            p(450000);





            Console.ReadLine();

        }



        public static void printsalary(int s)

        {

            Console.WriteLine("salary is :"+s);

        }





        public static void printeMPLOYEEID(int s)

        {

            Console.WriteLine("EmploeeId is :" + s);

        }











    }

}


No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...