Migrated to .NET 5, added records

This commit is contained in:
kunkliricsi 2020-11-12 18:13:23 +01:00
parent c92808ac7d
commit f273823c93
15 changed files with 46 additions and 26 deletions

View File

@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion> <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot> <SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<AssemblyName>Birdmap.API</AssemblyName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@ -20,9 +21,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" /> <PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.9" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.9" /> <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.9"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
@ -32,10 +33,11 @@
</PackageReference> </PackageReference>
<PackageReference Include="MQTTnet" Version="3.0.13" /> <PackageReference Include="MQTTnet" Version="3.0.13" />
<PackageReference Include="MQTTnet.AspNetCore" Version="3.0.13" /> <PackageReference Include="MQTTnet.AspNetCore" Version="3.0.13" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NLog" Version="4.7.5" /> <PackageReference Include="NLog" Version="4.7.5" />
<PackageReference Include="NLog.Web" Version="4.9.3" /> <PackageReference Include="NLog.Web" Version="4.9.3" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.3" /> <PackageReference Include="NLog.Web.AspNetCore" Version="4.9.3" />
<PackageReference Include="NSwag.AspNetCore" Version="13.8.2" /> <PackageReference Include="NSwag.AspNetCore" Version="13.9.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -0,0 +1,5 @@
import React, { Component } from 'react'
export default class Devices extends React.Component {
}

View File

@ -2,7 +2,7 @@
namespace Birdmap.Models namespace Birdmap.Models
{ {
public class AuthenticateRequest public record AuthenticateRequest
{ {
[Required(AllowEmptyStrings = false, ErrorMessage = "Username is required.")] [Required(AllowEmptyStrings = false, ErrorMessage = "Username is required.")]
public string Username { get; set; } public string Username { get; set; }

View File

@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Birdmap.API.DTOs namespace Birdmap.API.DTOs
{ {
public class AuthenticateResponse public record AuthenticateResponse
{ {
[JsonProperty("user_name")] [JsonProperty("user_name")]
public string Username { get; set; } public string Username { get; set; }

View File

@ -2,7 +2,7 @@
namespace Birdmap.API.DTOs namespace Birdmap.API.DTOs
{ {
public class RegisterRequest public record RegisterRequest
{ {
[Required(AllowEmptyStrings = false, ErrorMessage = "Username is required.")] [Required(AllowEmptyStrings = false, ErrorMessage = "Username is required.")]
public string Username { get; set; } public string Username { get; set; }

View File

@ -2,7 +2,7 @@
namespace Birdmap.API.DTOs namespace Birdmap.API.DTOs
{ {
public class ServiceInfo public record ServiceInfo
{ {
public ServiceRequest Service { get; set; } public ServiceRequest Service { get; set; }
public HttpStatusCode StatusCode { get; set; } public HttpStatusCode StatusCode { get; set; }

View File

@ -1,6 +1,6 @@
namespace Birdmap.API.DTOs namespace Birdmap.API.DTOs
{ {
public class ServiceRequest public record ServiceRequest
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } public string Name { get; set; }

View File

@ -1,9 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Birdmap.Common\Birdmap.Common.csproj" /> <ProjectReference Include="..\Birdmap.Common\Birdmap.Common.csproj" />
<ProjectReference Include="..\Birdmap.DAL\Birdmap.DAL.csproj" /> <ProjectReference Include="..\Birdmap.DAL\Birdmap.DAL.csproj" />

View File

@ -9,6 +9,7 @@
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type '...' is never equal to 'null' of type '...?'"
namespace Birdmap.BLL.Services namespace Birdmap.BLL.Services
{ {
@ -895,6 +896,7 @@ namespace Birdmap.BLL.Services
} }
} }
#pragma warning restore 8703
#pragma warning restore 1591 #pragma warning restore 1591
#pragma warning restore 1573 #pragma warning restore 1573
#pragma warning restore 472 #pragma warning restore 472

View File

@ -9,6 +9,7 @@
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type '...' is never equal to 'null' of type '...?'"
namespace Birdmap.BLL.Services namespace Birdmap.BLL.Services
{ {
@ -470,6 +471,7 @@ namespace Birdmap.BLL.Services
} }
#pragma warning restore 8703
#pragma warning restore 1591 #pragma warning restore 1591
#pragma warning restore 1573 #pragma warning restore 1573
#pragma warning restore 472 #pragma warning restore 472

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.9" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.9" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.9"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="3.1.9" /> <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="5.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -2,7 +2,7 @@
namespace Birdmap.DAL.Entities namespace Birdmap.DAL.Entities
{ {
public class Service public record Service
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } public string Name { get; set; }

View File

@ -6,7 +6,7 @@
Admin, Admin,
} }
public class User public record User
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } public string Name { get; set; }

View File

@ -1,18 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RootNamespace>MQTTnet.TestApp.WinForm</RootNamespace>
<AssemblyName>MQTTnet.TestApp.WinForm</AssemblyName>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="GitVersionTask" Version="5.3.3"> <PackageReference Include="GitVersionTask" Version="5.5.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MQTTnet" Version="3.0.11" /> <PackageReference Include="MQTTnet" Version="3.0.13" />
<PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="3.0.11" /> <PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="3.0.13" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup> </ItemGroup>