Beispiel #1
0
        protected string GetVerbsString(MethodVerbs verbs)
        {
            var verbsList = new List <string>();

            if (verbs.HasFlag(MethodVerbs.Get))
            {
                verbsList.Add("GET");
            }
            if (verbs.HasFlag(MethodVerbs.Post))
            {
                verbsList.Add("POST");
            }
            if (verbs.HasFlag(MethodVerbs.Put))
            {
                verbsList.Add("PUT");
            }
            if (verbs.HasFlag(MethodVerbs.Delete))
            {
                verbsList.Add("DELETE");
            }

            return(string.Join(",", verbsList));
        }
Beispiel #2
0
 public ServiceStackMethodRegistrationInfo(MethodVerbs verbs, string path, Type parameter)
 {
     Parameter = parameter;
     Path      = path;
     Verbs     = verbs;
 }
 public static void RegisterRestOperation <TParameter>(this ContainerBuilder builder, MethodVerbs verbs, string path)
 {
     builder.Register(c => new ServiceStackMethodRegistrationInfo(verbs, path, typeof(TParameter)));
 }