Add project files.

This commit is contained in:
2025-07-06 17:26:05 +02:00
parent 8edf3708d8
commit 0f7207523a
42 changed files with 1657 additions and 0 deletions

View File

@ -0,0 +1,35 @@
@page "/"
@*@inject Func<ISample1> factory*@
@inject IAbstractFactory<ISample1> factory
@inject IAbstractFactory<ISample2> sample2Factory
@inject IUserDataFactory userDataFactory
@inject IVehicleFactory vehicleFactory
<PageTitle>Index</PageTitle>
<h1>Hello @user?.Name (who drives a @vehicle.VehicleType)</h1>
<h2>@vehicle?.Start()</h2>
<h2>@currentTime?.CurrentDateTime</h2>
<h2>The random value is: @randomValue?.RandomValue</h2>
<button class="btn btn-primary" @onclick="GetNewTime">Get New Time</button>
@code {
ISample1? currentTime;
ISample2? randomValue;
IUserData? user;
IVehicle? vehicle;
protected override void OnInitialized()
{
user = userDataFactory.Create("Tommy Öman");
vehicle = vehicleFactory.Create("Car");
}
private void GetNewTime()
{
currentTime = factory.Create();
randomValue = sample2Factory.Create();
}
}