Ejemplo n.º 1
0
        public static T Delete <T>(string path, string resourceId, string presetName = "maestrano")
        {
            var request = new RestRequest();

            request.Resource = path;
            request.Method   = Method.DELETE;
            request.AddUrlSegment("id", resourceId);

            return(MnoClient.ProjectSingleObject <T>(request, presetName));
        }
Ejemplo n.º 2
0
        public static T Retrieve <T>(string path, string resourceId)
        {
            var request = new RestRequest();

            request.Resource = path;
            request.Method   = Method.GET;
            request.AddUrlSegment("id", resourceId);

            return(MnoClient.ProjectSingleObject <T>(request));
        }
Ejemplo n.º 3
0
        public static T Create <T>(string path, NameValueCollection parameters, string presetName = "maestrano")
        {
            var request = new RestRequest();

            request.Resource = path;
            request.Method   = Method.POST;

            foreach (var k in parameters.AllKeys)
            {
                request.AddParameter(StringExtensions.ToSnakeCase(k), parameters[k]);
            }

            return(MnoClient.ProjectSingleObject <T>(request, presetName));
        }