(refactor): code fix and migrate to .net7

This commit is contained in:
Maksym Sadovnychyy 2022-11-25 00:06:32 +01:00
parent dcc37d0a3e
commit f274f96b4d
23 changed files with 25 additions and 25 deletions

View File

@ -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() {

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>

View File

@ -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();
}
}

View File

@ -1,4 +1,4 @@
using Core.DomainObjects.Documents;
using DomainObjects.Documents;
using Core.Enumerations;
using Extensions;
using System.ComponentModel.DataAnnotations;

View File

@ -1,6 +1,6 @@
using Core.Enumerations;
using DataProviders.Collections;
using DomainObjects.Enumerations;
using Microsoft.AspNetCore.Authorization;
using WeatherForecast.Policies.Abstractions;
using WeatherForecast.Services;

View File

@ -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;

View File

@ -6,6 +6,7 @@ using DataProviders.Collections;
using WeatherForecast.Models.Responses;
using WeatherForecast.Models.Blog.Responses;
using DomainObjects.Enumerations;
namespace WeatherForecast.Services {

View File

@ -7,6 +7,7 @@ using Core.Abstractions;
using WeatherForecast.Models.Category.Requests;
using WeatherForecast.Models.Category.Responses;
using DomainObjects.Enumerations;
namespace WeatherForecast.Services {

View File

@ -7,6 +7,7 @@ using Core.Enumerations;
using WeatherForecast.Models.Responses;
using WeatherForecast.Models.Category.Responses;
using DomainObjects.Enumerations;
namespace WeatherForecast.Services {

View File

@ -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 {

View File

@ -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>