示例#1
0
        private async void RenderDetailsPage(ViewOptions options, HttpContext context)
        {
            var parts = context.Request.Path.Value.Split('/');
            var id    = Guid.Empty;

            if (!Guid.TryParse(parts[parts.Length - 1], out id))
            {
                context.Response.StatusCode = 400;
                await context.Response.WriteAsync("Invalid Id");

                return;
            }
            var model = new DetailsPageModel()
            {
                Activity = _store.GetActivities().Where(a => a.Id == id).FirstOrDefault(),
                Options  = options
            };
            var detailsPage = new DetailsPage(model);
            await detailsPage.ExecuteAsync(context);
        }