4
Answers

GetType() vs type()

Jaya Prakash

Jaya Prakash

1y
761
1

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)