7
Answers

Asp.Net Web Api 2 Attribute Routing

rahul ahuja

rahul ahuja

9y
1.2k
1
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)