7
Reply

Asp.Net Web Api 2 Attribute Routing

rahul ahuja

rahul ahuja

Nov 29 2015 12:57 AM
575
Hi All,
How to use attribute routing, Below is the code How I used in my project but does not work.
 
[Route("api/PropertyDetails/{ownerId}")]
public IEnumerable<PropertyDetailsTbl> GetPropertyDetailByOwerId(int ownerId)
{
   using (PropertyDetailsBusiness propertyDetailsBusiness = new PropertyDetailsBusiness())
   {
      List<PropertyDetailsTbl> list = propertyDetailsBusiness.GetAllByOwnerID(ownerId).ConvertAll(item => (PropertyDetailsTbl)item);
      return list as IEnumerable<PropertyDetailsTbl>;
   }
}
 
 
 
 
 
 
 
 

Answers (7)