private async Task HandleListing(IOwinContext context)
        {
            var baseAddress = context.Request.Uri.Scheme + "://" + context.Request.Uri.Host + ":" + context.Request.Uri.Port + "/";
            var stream      = ODataPackages.CreatePackagesStream(baseAddress, _repository.GetWebPackages());

            context.Response.ContentType = "application/atom+xml; charset=utf-8";
            await stream.CopyToAsync(context.Response.Body);
        }
        private async Task HandlePackageDetails(IOwinContext context, string id, string version)
        {
            var webPackage = _repository.GetPackage(id, version);

            if (webPackage == null)
            {
                return;
            }

            var stream = ODataPackages.CreatePackageStream(context.Request.Uri.Scheme + "://" + context.Request.Uri.Host + ":" + context.Request.Uri.Port + "/", webPackage);

            context.Response.ContentType = "application/atom+xml; charset=utf-8";
            await stream.CopyToAsync(context.Response.Body);
        }