Exemplo n.º 1
0
        public async Task Delete <TModel>(Guid id)
        {
            var resourceType = ModelRegistry.GetResourceType <TModel>();
            var request      = HttpRequestBuilder.DeleteResource(resourceType, id);
            var response     = await HttpClient.SendAsync(request);

            HttpResponseListener.DeleteResource(response.StatusCode, id, resourceType);
            response.CheckStatusCode();
            var model = Cache.Retrieve <TModel>(id);

            if (model != null)
            {
                ModelRegistry.DetachModel(model);
            }
            Cache.Remove(id);
        }