Jaya Prakash

Jaya Prakash

  • 538
  • 2.3k
  • 67k

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)