Exemplo n.º 1
0
        public Task <GetBeer> UpdateAsync(GetBeer resource, IRequestContext context, CancellationToken cancellation)
        {
            var officeId = context.UriParameters.GetByName <int>("OfficeId").EnsureValue(() => context.CreateHttpResponseException <Office>("The placeId must be supplied in the URI", HttpStatusCode.BadRequest));
            var kegId    = context.UriParameters.GetByName <int>("Id").EnsureValue(() => context.CreateHttpResponseException <Keg>("The placeId must be supplied in the URI", HttpStatusCode.BadRequest));

            _kegProvider.UpdateKeg(officeId, kegId, resource.Amount);
            return(Task.FromResult(resource));
        }
Exemplo n.º 2
0
        public Task <GetBeer> GetAsync(int id, IRequestContext context, CancellationToken cancellation)
        {
            var gb = new GetBeer();

            return(Task.FromResult(gb));
        }