public static Method ApiMethod(this ApiAction action)
{
Method method;
switch (action)
{
case ApiAction.INDEX:
case ApiAction.LIST:
method = Method.GET;
break;
case ApiAction.CREATE:
method = Method.POST;
break;
case ApiAction.DELETE:
method = Method.DELETE;
break;
case ApiAction.UPDATE:
method = Method.PUT;
break;
default:
method = Method.GET;
break;
}
return method;
}