rahul ahuja

rahul ahuja

  • NA
  • 80
  • 34.2k

Asp.Net Web Api 2 Attribute Routing

Nov 29 2015 12:57 AM
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)