Jaya Prakash

Jaya Prakash

  • 546
  • 2.3k
  • 64.8k

GetType() vs type()

Apr 25 2023 5:05 AM

Pls explain me what is happening here in the if condition  why he is comparing object with a class

what is GetType() and typeof();

pls explain  me   this line also   AGTransaction objTransactionIDRequest = (AGTransaction)objAGRequest;

is this a conversion???

 

 public override object CreateOrder(object objAGRequest) 
        {
                if (objPGRequest.GetType() == typeof(AGTransaction))
                {
                    AGTransaction objTransactionIDRequest = (AGTransaction)objAGRequest;
                }
        }

 


Answers (4)