Ejemplo n.º 1
0
 private void SetHttpMethod(ActionModel actionModel)
 {
     if (!actionModel.IsNeedSetHttpMethod())
     {
         return;
     }
     actionModel.Attributes.Add(new HttpPostAttribute());
     if (actionModel.Parameters.Count(f => f.Attributes.Where(attr => attr is FromBodyAttribute || attr is FromFormAttribute).Count() > 0) == 0)
     {
         actionModel.Attributes.Add(new HttpGetAttribute());
     }
 }