Beispiel #1
0
 public EmpleadoConsultarGetRequest(GetEmpleadoConsultarQuery Query = null)
 {
     this.Query = Query;
 }
Beispiel #2
0
        /// <summary>
        /// Consultar empleado - /Empleado/consultar
        /// </summary>
        /// <param name="getempleadoconsultarquery">query properties</param>
        public virtual async Task <practica1.Empleado.Models.EmpleadoConsultarGetResponse> Get(practica1.Empleado.Models.GetEmpleadoConsultarQuery getempleadoconsultarquery)
        {
            var url = "/Empleado/consultar";

            if (getempleadoconsultarquery != null)
            {
                url += "?";
                if (getempleadoconsultarquery.RestKey != null)
                {
                    url += "&RestKey=" + Uri.EscapeDataString(getempleadoconsultarquery.RestKey);
                }
                if (getempleadoconsultarquery.DNI != null)
                {
                    url += "&DNI=" + Uri.EscapeDataString(getempleadoconsultarquery.DNI);
                }
            }

            url = url.Replace("?&", "?");

            var req      = new HttpRequestMessage(HttpMethod.Get, url.StartsWith("/") ? url.Substring(1) : url);
            var response = await proxy.Client.SendAsync(req);

            return(new practica1.Empleado.Models.EmpleadoConsultarGetResponse
            {
                RawContent = response.Content,
                RawHeaders = response.Headers,
                StatusCode = response.StatusCode,
                ReasonPhrase = response.ReasonPhrase,
                SchemaValidation = new Lazy <SchemaValidationResults>(() => new SchemaValidationResults(true), true)
            });
        }