(refactor): code fix and migrate to .net7
This commit is contained in:
parent
dcc37d0a3e
commit
f274f96b4d
@ -27,15 +27,11 @@ public class UserDocument : DomainObjectDocumentBase<UserDocument> {
|
|||||||
|
|
||||||
public Roles Role { get; set; }
|
public Roles Role { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void SetPassword (string password) {
|
public void SetPassword (string password) {
|
||||||
|
if (Passwords.Password != null)
|
||||||
|
Passwords.Expired.Add(Passwords.Password.Prototype());
|
||||||
|
|
||||||
|
Passwords.Password = new Password(password);
|
||||||
|
|
||||||
var old = Passwords.Password.Prototype();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode() {
|
public override int GetHashCode() {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||||
|
|||||||
@ -171,6 +171,8 @@ namespace ExtensionMethods {
|
|||||||
public static DateTime ToDateTime(this string s, string[] formats) {
|
public static DateTime ToDateTime(this string s, string[] formats) {
|
||||||
if (s == "Now")
|
if (s == "Now")
|
||||||
return DateTime.Now;
|
return DateTime.Now;
|
||||||
|
else if (s == "UtcNow")
|
||||||
|
return DateTime.UtcNow;
|
||||||
else if (s == "Today")
|
else if (s == "Today")
|
||||||
return DateTime.Today;
|
return DateTime.Today;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using DomainObjects;
|
using DomainObjects;
|
||||||
using DataProviders.Collections;
|
using DataProviders.Collections;
|
||||||
using DomainResults.Mvc;
|
using DomainResults.Mvc;
|
||||||
using ExtensionMethods;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using WeatherForecast.Models.Account.Requests;
|
using WeatherForecast.Models.Account.Requests;
|
||||||
@ -85,7 +84,6 @@ public class AccountController : ControllerBase {
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For authenticated users that want to change their password the PUT request can be performed immediately without the email
|
/// For authenticated users that want to change their password the PUT request can be performed immediately without the email
|
||||||
/// (the account for which we are updating the password is known to the server). In such case the form will submit two fields
|
/// (the account for which we are updating the password is known to the server). In such case the form will submit two fields
|
||||||
@ -109,5 +107,4 @@ public class AccountController : ControllerBase {
|
|||||||
|
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using Core.DomainObjects.Documents;
|
using DomainObjects.Documents;
|
||||||
using Core.Enumerations;
|
using Core.Enumerations;
|
||||||
using Extensions;
|
using Extensions;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using Core.Enumerations;
|
using Core.Enumerations;
|
||||||
using DataProviders.Collections;
|
using DataProviders.Collections;
|
||||||
|
using DomainObjects.Enumerations;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using WeatherForecast.Policies.Abstractions;
|
using WeatherForecast.Policies.Abstractions;
|
||||||
using WeatherForecast.Services;
|
using WeatherForecast.Services;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using Core.Enumerations;
|
using Core.Enumerations;
|
||||||
using DataProviders;
|
using DataProviders;
|
||||||
using DataProviders.Collections;
|
using DataProviders.Collections;
|
||||||
|
using DomainObjects.Enumerations;
|
||||||
using FileSecurityService;
|
using FileSecurityService;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using WeatherForecast.Policies.Abstractions;
|
using WeatherForecast.Policies.Abstractions;
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using DataProviders.Collections;
|
|||||||
|
|
||||||
using WeatherForecast.Models.Responses;
|
using WeatherForecast.Models.Responses;
|
||||||
using WeatherForecast.Models.Blog.Responses;
|
using WeatherForecast.Models.Blog.Responses;
|
||||||
|
using DomainObjects.Enumerations;
|
||||||
|
|
||||||
namespace WeatherForecast.Services {
|
namespace WeatherForecast.Services {
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using Core.Abstractions;
|
|||||||
|
|
||||||
using WeatherForecast.Models.Category.Requests;
|
using WeatherForecast.Models.Category.Requests;
|
||||||
using WeatherForecast.Models.Category.Responses;
|
using WeatherForecast.Models.Category.Responses;
|
||||||
|
using DomainObjects.Enumerations;
|
||||||
|
|
||||||
namespace WeatherForecast.Services {
|
namespace WeatherForecast.Services {
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using Core.Enumerations;
|
|||||||
|
|
||||||
using WeatherForecast.Models.Responses;
|
using WeatherForecast.Models.Responses;
|
||||||
using WeatherForecast.Models.Category.Responses;
|
using WeatherForecast.Models.Category.Responses;
|
||||||
|
using DomainObjects.Enumerations;
|
||||||
|
|
||||||
namespace WeatherForecast.Services {
|
namespace WeatherForecast.Services {
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ using Core.Enumerations;
|
|||||||
using WeatherForecast.Models;
|
using WeatherForecast.Models;
|
||||||
using WeatherForecast.Models.Responses;
|
using WeatherForecast.Models.Responses;
|
||||||
using WeatherForecast.Models.Shop.Responses;
|
using WeatherForecast.Models.Shop.Responses;
|
||||||
|
using DomainObjects.Enumerations;
|
||||||
|
|
||||||
namespace WeatherForecast.Services {
|
namespace WeatherForecast.Services {
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<RootNamespace>WeatherForecast</RootNamespace>
|
<RootNamespace>WeatherForecast</RootNamespace>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user