diff --git a/MVC/Pay.cshtml b/MVC/Pay.cshtml new file mode 100644 index 0000000..494a39b --- /dev/null +++ b/MVC/Pay.cshtml @@ -0,0 +1,3 @@ +@page "{username}" +@model OembedTests.MVC.PayModel +

@Model.username

diff --git a/MVC/Pay.cshtml.cs b/MVC/Pay.cshtml.cs new file mode 100644 index 0000000..bcadd28 --- /dev/null +++ b/MVC/Pay.cshtml.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace OembedTests.MVC +{ + public class PayModel : PageModel + { + public string username { get; set; } + public void OnGet(string username) + { + this.username = username; + } + } +} diff --git a/MVC/_Layout.cshtml b/MVC/_Layout.cshtml new file mode 100644 index 0000000..393855a --- /dev/null +++ b/MVC/_Layout.cshtml @@ -0,0 +1,19 @@ + + + + + + @ViewBag.Title + @{ + string oembedUrl = "https://" + Context.Request.Host.Host + "/oembed"; + } + + + +
+ @RenderBody() +
+ + diff --git a/Startup.cs b/Startup.cs index e953c19..9b4e401 100644 --- a/Startup.cs +++ b/Startup.cs @@ -20,7 +20,8 @@ services .AddSwaggerGen() .AddSingleton(configuration) - .AddEndpointsApiExplorer(); + .AddEndpointsApiExplorer() + .AddRazorPages(); } @@ -41,6 +42,7 @@ app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapRazorPages(); }); } }