(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 void SetPassword (string password) {
|
||||
if (Passwords.Password != null)
|
||||
Passwords.Expired.Add(Passwords.Password.Prototype());
|
||||
|
||||
|
||||
|
||||
var old = Passwords.Password.Prototype();
|
||||
|
||||
|
||||
Passwords.Password = new Password(password);
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
|
||||
@ -171,6 +171,8 @@ namespace ExtensionMethods {
|
||||
public static DateTime ToDateTime(this string s, string[] formats) {
|
||||
if (s == "Now")
|
||||
return DateTime.Now;
|
||||
else if (s == "UtcNow")
|
||||
return DateTime.UtcNow;
|
||||
else if (s == "Today")
|
||||
return DateTime.Today;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using DomainObjects;
|
||||
using DataProviders.Collections;
|
||||
using DomainResults.Mvc;
|
||||
using ExtensionMethods;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WeatherForecast.Models.Account.Requests;
|
||||
@ -85,7 +84,6 @@ public class AccountController : ControllerBase {
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
@ -109,5 +107,4 @@ public class AccountController : ControllerBase {
|
||||
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Core.DomainObjects.Documents;
|
||||
using DomainObjects.Documents;
|
||||
using Core.Enumerations;
|
||||
using Extensions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
using Core.Enumerations;
|
||||
using DataProviders.Collections;
|
||||
|
||||
using DomainObjects.Enumerations;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using WeatherForecast.Policies.Abstractions;
|
||||
using WeatherForecast.Services;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using Core.Enumerations;
|
||||
using DataProviders;
|
||||
using DataProviders.Collections;
|
||||
using DomainObjects.Enumerations;
|
||||
using FileSecurityService;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using WeatherForecast.Policies.Abstractions;
|
||||
|
||||
@ -6,6 +6,7 @@ using DataProviders.Collections;
|
||||
|
||||
using WeatherForecast.Models.Responses;
|
||||
using WeatherForecast.Models.Blog.Responses;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace WeatherForecast.Services {
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ using Core.Abstractions;
|
||||
|
||||
using WeatherForecast.Models.Category.Requests;
|
||||
using WeatherForecast.Models.Category.Responses;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace WeatherForecast.Services {
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ using Core.Enumerations;
|
||||
|
||||
using WeatherForecast.Models.Responses;
|
||||
using WeatherForecast.Models.Category.Responses;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace WeatherForecast.Services {
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ using Core.Enumerations;
|
||||
using WeatherForecast.Models;
|
||||
using WeatherForecast.Models.Responses;
|
||||
using WeatherForecast.Models.Shop.Responses;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace WeatherForecast.Services {
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>WeatherForecast</RootNamespace>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user