Exemplo n.º 1
0
        protected virtual HttpRequestMessage CreateRequest(GetEntityCommand cmd)
        {
            var req = new HttpRequest(HttpMethod.Get, GenerateRequestUrl(cmd.Id, cmd.Rev));

            req.SetIfMatch(cmd.Rev);

            return(req);
        }
Exemplo n.º 2
0
        public virtual async Task <EntityResponse <T> > GetAsync <T>(GetEntityCommand cmd) where T : class
        {
            Ensure.That(cmd, "cmd").IsNotNull();

            var req = CreateRequest(cmd);
            var res = SendAsync(req);

            return(ProcessEntityResponse <T>(cmd, await res.ForAwait()));
        }
Exemplo n.º 3
0
 public static Task <EntityResponse <T> > ExecuteAsync <T>(this IClient client, GetEntityCommand cmd) where T : class
 {
     return(client.Entities.GetAsync <T>(cmd));
 }
Exemplo n.º 4
0
 protected virtual EntityResponse <T> ProcessEntityResponse <T>(GetEntityCommand cmd, HttpResponseMessage response) where T : class
 {
     return(EntityResponseFactory.Create <T>(response));
 }