veerendra kumar

veerendra kumar

  • NA
  • 47
  • 20.5k

WEB API

Apr 29 2015 9:45 AM
i am using WEB API concept in asp.net application.
 
in my API contain one method is post with  two argument.
ex:
public string Post(dynamic obj,int type)
{
 if(type==1)
INSERT DATA INTO THE EMP TABLE. NOW obj Conatin ename, eid,salary..... like.
Empentity.Emp.add(emp);
return true;
}
else
{
 
INSERT DATA INTO THE Dept TABLE. NOW obj Conatin Dname, location
Empentity.Dept.add(emp):  
return true;
 
}
 
}
 
 
 
 
how to convert dynamic object data to emp or dept object type.  my data pass in JSON format.
 
 
 
 
 
 
 

Answers (1)