forked from BlazorRepl/BlazorRepl
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new templates and mostly get working on .NET 8
- Loading branch information
1 parent
c5a18c3
commit ee30743
Showing
10 changed files
with
63 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
@page "/user-page" | ||
|
||
<MudContainer Class="mt-8"> | ||
<MudText>This snippet hasn't been compiled yet.</MudText> | ||
<MudText>Run the code on the left to see the result here.</MudText> | ||
<MudText Typo="@Typo.h6" Class="mt-12">How to load your own service</MudText> | ||
<MudText Class="mt-3"> | ||
To install a service which your snippet can use create a new *.cs file, <br/> | ||
define a <code class="mud-primary-text">class UserStartup</code> with a <code class="mud-primary-text">public static void Configure(WebAssemblyHostBuilder builder)</code>. | ||
</MudText> | ||
<br/> | ||
<MudText>Here is an example. Note the required usings!</MudText> | ||
<pre class="mt-6"> | ||
namespace Try.UserComponents | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
// required using for UserStartup: | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
public class UserStartup | ||
{ | ||
public static void Configure(WebAssemblyHostBuilder builder) { | ||
builder.Services.AddSingleton(new MyService()); | ||
} | ||
} | ||
|
||
// your service | ||
public class MyService { | ||
public string Hello() => "Hello World from MyService!"; | ||
} | ||
|
||
@page "/user-page" | ||
|
||
<MudContainer Class="mt-8"> | ||
<MudText>This snippet hasn't been compiled yet.</MudText> | ||
<MudText>Run the code on the left to see the result here.</MudText> | ||
<MudText Typo="@Typo.h6" Class="mt-12">How to load your own service</MudText> | ||
<MudText Class="mt-3"> | ||
To install a service which your snippet can use create a new *.cs file, <br/> | ||
define a <code class="mud-primary-text">class UserStartup</code> with a <code class="mud-primary-text">public static void Configure(WebAssemblyHostBuilder builder)</code>. | ||
</MudText> | ||
<br/> | ||
<MudText>Here is an example. Note the required usings!</MudText> | ||
<pre class="mt-6"> | ||
namespace Try.UserComponents | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
// required using for UserStartup: | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
public class UserStartup | ||
{ | ||
public static void Configure(WebAssemblyHostBuilder builder) { | ||
builder.Services.AddSingleton(new MyService()); | ||
} | ||
} | ||
|
||
// your service | ||
public class MyService { | ||
public string Hello() => "Hello World from MyService!"; | ||
} | ||
|
||
} | ||
</pre> | ||
</MudContainer> | ||
|
||
|
||
</pre> | ||
</MudContainer> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@using System.Net.Http | ||
@using System.Net.Http.Json | ||
@using Microsoft.AspNetCore.Components.Forms | ||
@using Microsoft.AspNetCore.Components.Routing | ||
@using Microsoft.AspNetCore.Components.Web | ||
@using static Microsoft.AspNetCore.Components.Web.RenderMode | ||
@using Microsoft.AspNetCore.Components.Web.Virtualization | ||
@using Microsoft.JSInterop | ||
@using TryMudBlazor.Client | ||
@using TryMudBlazor.Client.Components | ||
@using TryMudBlazor.Client.Shared | ||
@using MudBlazor |