dotnet-podcasts/docs/demos/aspnetcore-blazor/README.md

53 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2022-04-22 02:36:13 +08:00
### Web (ASP.NET Core Razor & Blazor)
2022-04-22 05:53:22 +08:00
The ASP.NET Core and Blazor apps are setup to run locally against the APIs running in Docker. If you are unable to deploy locally, you can use these pre-deployed services:
2022-04-22 02:36:13 +08:00
Open up ` src/Web/Server/appsettings.Development.json` and `src/Web/Client/wwwroot/appsettings.Development.json` enter this for both
```json
"PodcastApi": {
2022-11-29 04:06:13 +08:00
"BaseAddress": "https://podcastapica.ashyhill-df3dfdf5.eastus.azurecontainerapps.io"
2022-04-22 02:36:13 +08:00
},
"ListenTogetherHub": "https://dotnetpodcasts-listentogether-hub.azurewebsites.net/listentogether"
```
Watch the .NET Conf 2021 demo of .NET MAUI here: https://youtu.be/gYQxBHjRNr0?t=2699
### Demo Script Snippets
```razor
<ul>
@foreach (var item in showSubscriptions)
{
<li>
<h2>@item.Title</h2>
<h3>@item.Author</h3>
<img src="@item.Image" />
</li>
}
</ul>
```
```razor
<ShowCard Id="@item.Id" Title="@item.Title" Author="@item.Author" Image="@item.Image" />
```
```razor
<Grid Items="@showSubscriptions" TItem="ShowInfo">
<ItemTemplate Context="item">
<NavLink @key="item.Id" href="@($"show/{item.Id}")">
<ShowCard Id="@item.Id" Title="@item.Title" Author="@item.Author" Image="@item.Image" />
</NavLink>
</ItemTemplate>
<EmptyResults>
</EmptyResults>
</Grid>
```
```razor
<NoResults Message="You havent subscribed to any channel yet."
Description="Discover content according to your interests."
Image="_content/Podcast.Pages/images/no-subscriptions.png" />
```