Skip to content

Instantly share code, notes, and snippets.

View samueleresca's full-sized avatar

Samuele Resca samueleresca

View GitHub Profile
public class Program
{
...
public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
BlazorWebAssemblyHost.CreateDefaultBuilder()
.UseBlazorStartup<Startup>();
}
@functions {
WeatherForecast[] forecasts;
protected override async Task OnInitAsync()
{
forecasts = await Http.GetJsonAsync<WeatherForecast[]>("sample-data/weather.json");
}
class WeatherForecast
{
@page "/fetchdata"
@inject HttpClient Http
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
using Microsoft.AspNetCore.Components.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace HandsOn.WebAssemblyUsingBlazor
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
using Microsoft.AspNetCore.Blazor.Hosting;
namespace HandsOn.WebAssemblyUsingBlazor
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
.
├── App.razor
├── HandsOn.WebAssemblyUsingBlazor.csproj
├── Pages
│   ├── Counter.razor
│   ├── FetchData.razor
│   ├── Index.razor
│   └── _Imports.razor
├── Program.cs
├── Shared
using System;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using VinylStore.Catalog.Domain.Entities;
namespace VinylStore.Catalog.Infrastructure.SchemaDefinitions
{
public class ItemEntitySchemaDefinition : IEntityTypeConfiguration<Item>
{
let filteredLyrics = songLyrics |> Seq.filter(fun row -> row.Genre = "Hip-Hop" )
tokenizeLyrics filteredLyrics
|> renderLineChartForWords
tokenizeLyrics songLyrics
|> renderLineChartForWords
let tokenizeLyrics (lyrics: seq<LyricsInput>) =
...
let transformedData = pipeline.Fit(data).Transform(data)
transformedData.GetColumn<string[]>(mlContext, "LyricsWithNoStopWords")
|> Seq.concat
|> Seq.toList