{"id":389173,"date":"2024-06-29T08:25:28","date_gmt":"2024-06-29T08:25:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=389173"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=389173","title":{"rendered":"<span>Blazor WebAssembly: \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e JSON-\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/blazor\/components\/dynamiccomponent?view=aspnetcore-6.0\" rel=\"noopener noreferrer nofollow\"><u>DynamicComponent<\/u><\/a> \u0438\u0437 ASP.NET Core 6.0 (\u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 Preview).<\/p>\n<p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0444\u043e\u0440\u043c:<\/p>\n<ul>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f JSON-\u043e\u043c;<\/p>\n<\/li>\n<li>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (\u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044b) \u0444\u043e\u0440\u043c\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 dll-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/alexeyboiko.github.io\/FormDesignerDemo\/\" rel=\"noopener noreferrer nofollow\">Blazor WebAssembly form builder demo<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d9\/79a\/d01\/3d979ad01932541ce99c60647981c3d6.gif\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0444\u043e\u0440\u043c \u043d\u0430 Blazor WebAssembly\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0444\u043e\u0440\u043c \u043d\u0430 Blazor WebAssembly\" width=\"674\" height=\"526\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d9\/79a\/d01\/3d979ad01932541ce99c60647981c3d6.gif\"\/><figcaption>\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0444\u043e\u0440\u043c \u043d\u0430 Blazor WebAssembly<\/figcaption><\/figure>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c &#8212; NumButton  <\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c (Num) \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c (OnClick):<\/p>\n<pre><code class=\"cs\">&lt;button type=\"button\" @onclick=Click>@Num&lt;\/button>  @code {     [Parameter]     public int Num { get; set; }      [Parameter]     public EventCallback&lt;int> OnClick { get; set; }      async Task Click()          => await OnClick.InvokeAsync(Num); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 1. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 NumButton<\/em><\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435, \u043d\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 NumButton:<\/p>\n<pre><code class=\"cs\">&lt;NumButton Num=10 OnClick=Click \/>  @code {       async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 2. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 NumButton<\/em><\/p>\n<h2>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/h2>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicComponent \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c NumButton:<\/p>\n<pre><code class=\"cs\">&lt;DynamicComponent Type=ComponentType Parameters=ComponentParameters \/>  @code {     Type ComponentType;     Dictionary&lt;string, object> ComponentParameters;      protected override void OnInitialized() {         ComponentType = typeof(NumButton);         ComponentParameters = new Dictionary&lt;string, object> {             { \"Num\", 10}         };     }      async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 3. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 NumButton \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicComponent. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a OnClick \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f.<\/em><\/p>\n<p>CompnentType &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u0438\u043f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430,<br \/>ComponentParameters &#8212; \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/blazor\/components\/dynamiccomponent\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e DynamicComponent<\/u><\/a>. \u041d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u201cOnClick\u201d.<\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c EventCallback.Factory:<\/p>\n<pre><code class=\"cs\">&lt;DynamicComponent Type=ComponentType Parameters=ComponentParameters \/>  @code {     Type ComponentType;     Dictionary&lt;string, object> ComponentParameters;      protected override void OnInitialized() {         ComponentType = typeof(NumButton);         ComponentParameters = new Dictionary&lt;string, object> {             { \"Num\", 10},              \/\/ event subscription             { \"OnClick\", EventCallback.Factory.Create&lt;int>(this, Click)}         };     }      async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); } <\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 4. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 NumButton \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicComponent \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u201cOnClick\u201d.<\/em><\/p>\n<h2>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/h2>\n<p>JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"json\">{     \"TypeName\": \"FormDesignerDemo.Components.NumButton\",     \"Parameters\": {         \"Num\": {             \"TypeName\": \"System.Int32\",             \"Value\": 10         }     } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 5. JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 NumButton<\/em><\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u201cNum\u201d \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#171;System.Int32&#187;) \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c. \u0422\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c. \u041b\u0438\u0448\u044c \u0431\u044b \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432 JSON.<\/p>\n<p>\u0422\u0430\u043a\u043e\u043c\u0443 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<pre><code class=\"cs\">class ComponentDto {     public string TypeName { get; set; }     public Dictionary&lt;string, ParameterValueDto> Parameters { get; set; } }  class ParameterValueDto {     public string TypeName { get; set; }     public object Value { get; set; } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 6. Data Transfer Object \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 JSON.<\/em><\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c JSON \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f. \u0412 Blazor \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435<\/p>\n<pre><code class=\"cs\">await Http.GetFromJsonAsync&lt;ComponentDto>(...)<\/code><\/pre>\n<p>\u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code class=\"cs\">class ComponentDescription {     public Type ComponentType { get; set; }     public Dictionary&lt;string, object> Parameters { get; set; } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 7. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/em><\/p>\n<p>\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u043b\u043a\u0443 \u0438\u0437 DTO \u0432 ComponentDescription:<\/p>\n<pre><code class=\"cs\">static class ComponentDtoToComponent {     public static ComponentDescription ToComponent(this ComponentDto dto) {         return new ComponentDescription {             ComponentType = Type.GetType(dto.TypeName),             Parameters = dto.Parameters?.ToDictionary(                 pp => pp.Key,                 pp => pp.Value != null                     ? JsonSerializer.Deserialize(                         ((JsonElement)pp.Value.Value).GetRawText(),                          Type.GetType(pp.Value.TypeName))                     : null)                 ?? new Dictionary&lt;string, object>()         };     } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8. \u0414\u0435\u043b\u0430\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 DTO<\/em> <\/p>\n<p>\u0412\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"cs\">&lt;DynamicComponent Type=Comp.ComponentType Parameters=Comp.Parameters \/>  @code {     ComponentDescription Comp;      protected override void OnInitialized() {          Comp = JsonSerializer.Deserialize&lt;ComponentDto>(@\"             {                 \"\"TypeName\"\": \"\"FormDesignerDemo.Components.NumButton\"\",                 \"\"Parameters\"\": {                     \"\"Num\"\": {                         \"\"TypeName\"\": \"\"System.Int32\"\",                         \"\"Value\"\": 10                     }                 }             }\")         .ToComponent();          Comp.Parameters.Add(\"OnClick\", EventCallback.Factory.Create&lt;int>(this, Click));     }      async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 9. \u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/577174\/\"> https:\/\/habr.com\/ru\/articles\/577174\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e JSON-\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/blazor\/components\/dynamiccomponent?view=aspnetcore-6.0\" rel=\"noopener noreferrer nofollow\"><u>DynamicComponent<\/u><\/a> \u0438\u0437 ASP.NET Core 6.0 (\u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 Preview).<\/p>\n<p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0444\u043e\u0440\u043c:<\/p>\n<ul>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f JSON-\u043e\u043c;<\/p>\n<\/li>\n<li>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (\u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044b) \u0444\u043e\u0440\u043c\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 dll-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/alexeyboiko.github.io\/FormDesignerDemo\/\" rel=\"noopener noreferrer nofollow\">Blazor WebAssembly form builder demo<\/a>.<\/p>\n<figure class=\"full-width\"><figcaption>\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0444\u043e\u0440\u043c \u043d\u0430 Blazor WebAssembly<\/figcaption><\/figure>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c &#8212; NumButton  <\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c (Num) \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c (OnClick):<\/p>\n<pre><code class=\"cs\">&lt;button type=\"button\" @onclick=Click>@Num&lt;\/button>  @code {     [Parameter]     public int Num { get; set; }      [Parameter]     public EventCallback&lt;int> OnClick { get; set; }      async Task Click()          => await OnClick.InvokeAsync(Num); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 1. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 NumButton<\/em><\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435, \u043d\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 NumButton:<\/p>\n<pre><code class=\"cs\">&lt;NumButton Num=10 OnClick=Click \/>  @code {       async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 2. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 NumButton<\/em><\/p>\n<h2>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/h2>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicComponent \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c NumButton:<\/p>\n<pre><code class=\"cs\">&lt;DynamicComponent Type=ComponentType Parameters=ComponentParameters \/>  @code {     Type ComponentType;     Dictionary&lt;string, object> ComponentParameters;      protected override void OnInitialized() {         ComponentType = typeof(NumButton);         ComponentParameters = new Dictionary&lt;string, object> {             { \"Num\", 10}         };     }      async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 3. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 NumButton \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicComponent. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a OnClick \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f.<\/em><\/p>\n<p>CompnentType &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u0438\u043f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430,<br \/>ComponentParameters &#8212; \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/blazor\/components\/dynamiccomponent\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e DynamicComponent<\/u><\/a>. \u041d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u201cOnClick\u201d.<\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c EventCallback.Factory:<\/p>\n<pre><code class=\"cs\">&lt;DynamicComponent Type=ComponentType Parameters=ComponentParameters \/>  @code {     Type ComponentType;     Dictionary&lt;string, object> ComponentParameters;      protected override void OnInitialized() {         ComponentType = typeof(NumButton);         ComponentParameters = new Dictionary&lt;string, object> {             { \"Num\", 10},              \/\/ event subscription             { \"OnClick\", EventCallback.Factory.Create&lt;int>(this, Click)}         };     }      async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); } <\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 4. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 NumButton \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicComponent \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u201cOnClick\u201d.<\/em><\/p>\n<h2>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/h2>\n<p>JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"json\">{     \"TypeName\": \"FormDesignerDemo.Components.NumButton\",     \"Parameters\": {         \"Num\": {             \"TypeName\": \"System.Int32\",             \"Value\": 10         }     } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 5. JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 NumButton<\/em><\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u201cNum\u201d \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#171;System.Int32&#187;) \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c. \u0422\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c. \u041b\u0438\u0448\u044c \u0431\u044b \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432 JSON.<\/p>\n<p>\u0422\u0430\u043a\u043e\u043c\u0443 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<pre><code class=\"cs\">class ComponentDto {     public string TypeName { get; set; }     public Dictionary&lt;string, ParameterValueDto> Parameters { get; set; } }  class ParameterValueDto {     public string TypeName { get; set; }     public object Value { get; set; } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 6. Data Transfer Object \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 JSON.<\/em><\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c JSON \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f. \u0412 Blazor \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435<\/p>\n<pre><code class=\"cs\">await Http.GetFromJsonAsync&lt;ComponentDto>(...)<\/code><\/pre>\n<p>\u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code class=\"cs\">class ComponentDescription {     public Type ComponentType { get; set; }     public Dictionary&lt;string, object> Parameters { get; set; } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 7. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/em><\/p>\n<p>\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u043b\u043a\u0443 \u0438\u0437 DTO \u0432 ComponentDescription:<\/p>\n<pre><code class=\"cs\">static class ComponentDtoToComponent {     public static ComponentDescription ToComponent(this ComponentDto dto) {         return new ComponentDescription {             ComponentType = Type.GetType(dto.TypeName),             Parameters = dto.Parameters?.ToDictionary(                 pp => pp.Key,                 pp => pp.Value != null                     ? JsonSerializer.Deserialize(                         ((JsonElement)pp.Value.Value).GetRawText(),                          Type.GetType(pp.Value.TypeName))                     : null)                 ?? new Dictionary&lt;string, object>()         };     } }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8. \u0414\u0435\u043b\u0430\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 DTO<\/em> <\/p>\n<p>\u0412\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"cs\">&lt;DynamicComponent Type=Comp.ComponentType Parameters=Comp.Parameters \/>  @code {     ComponentDescription Comp;      protected override void OnInitialized() {          Comp = JsonSerializer.Deserialize&lt;ComponentDto>(@\"             {                 \"\"TypeName\"\": \"\"FormDesignerDemo.Components.NumButton\"\",                 \"\"Parameters\"\": {                     \"\"Num\"\": {                         \"\"TypeName\"\": \"\"System.Int32\"\",                         \"\"Value\"\": 10                     }                 }             }\")         .ToComponent();          Comp.Parameters.Add(\"OnClick\", EventCallback.Factory.Create&lt;int>(this, Click));     }      async Task Click(int count)         => await JsRuntime.InvokeVoidAsync(\"alert\", count); }<\/code><\/pre>\n<p><em>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 9. \u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e JSON \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/577174\/\"> https:\/\/habr.com\/ru\/articles\/577174\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-389173","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/389173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=389173"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/389173\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}