Added initial Uno Platform frontend project.

This commit is contained in:
2023-04-28 17:56:23 +02:00
parent 1296f363af
commit b2aba31264
96 changed files with 3530 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Suppress Compiler warnings for elements without XML Docs -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,22 @@
using System.Collections.Immutable;
using System.Text.Json.Serialization;
namespace FrontendPlatformUno.DataContracts.Serialization
{
/*
* When using the JsonSerializerContext you must add the JsonSerializableAttribute
* for each type that you may need to serialize / deserialize including both the
* concrete type and any interface that the concrete type implements.
* For more information on the JsonSerializerContext see:
* https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation?WT.mc_id=DT-MVP-5002924
*/
[JsonSerializable(typeof(WeatherForecast))]
[JsonSerializable(typeof(WeatherForecast[]))]
[JsonSerializable(typeof(IEnumerable<WeatherForecast>))]
[JsonSerializable(typeof(IImmutableList<WeatherForecast>))]
[JsonSerializable(typeof(ImmutableList<WeatherForecast>))]
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
public partial class WeatherForecastContext : JsonSerializerContext
{
}
}

View File

@@ -0,0 +1,16 @@
namespace FrontendPlatformUno.DataContracts
{
/// <summary>
/// A Weather Forecast for a specific date
/// </summary>
/// <param name="Date">Gets the Date of the Forecast.</param>
/// <param name="TemperatureC">Gets the Forecast Temperature in Celsius.</param>
/// <param name="Summary">Get a description of how the weather will feel.</param>
public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
/// <summary>
/// Gets the Forecast Temperature in Fahrenheit
/// </summary>
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}