diff --git a/Directory.Build.props b/Directory.Build.props
index 340a75f33b7..f0e8124a5d9 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -15,6 +15,10 @@
$(NoWarn);S3875;S4457
+
+ true
+
+
$(VersionPrefix)
diff --git a/VirtoCommerce.Platform.sln.DotSettings b/VirtoCommerce.Platform.sln.DotSettings
index fc91addd8bf..c81792632ba 100644
--- a/VirtoCommerce.Platform.sln.DotSettings
+++ b/VirtoCommerce.Platform.sln.DotSettings
@@ -2,6 +2,7 @@
UI
<Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" />
<Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></Policy>
+ <Policy><Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></Policy>
True
True
True
diff --git a/module.ignore b/module.ignore
index 314bbf67bf1..e77ae7cba43 100644
--- a/module.ignore
+++ b/module.ignore
@@ -1,7 +1,6 @@
Azure.Core.dll
Azure.Data.AppConfiguration.dll
Azure.Identity.dll
-Azure.Messaging.EventGrid.dll
Azure.Security.KeyVault.Secrets.dll
Dapper.dll
DnsClient.dll
@@ -20,13 +19,6 @@ Hangfire.SqlServer.dll
Humanizer.dll
MessagePack.Annotations.dll
MessagePack.dll
-Microsoft.AI.DependencyCollector.dll
-Microsoft.AI.EventCounterCollector.dll
-Microsoft.AI.PerfCounterCollector.dll
-Microsoft.AI.ServerTelemetryChannel.dll
-Microsoft.AI.WindowsServer.dll
-Microsoft.ApplicationInsights.AspNetCore.dll
-Microsoft.ApplicationInsights.dll
Microsoft.AspNetCore.Authentication.JwtBearer.dll
Microsoft.AspNetCore.Authentication.OpenIdConnect.dll
Microsoft.AspNetCore.Authorization.dll
@@ -84,7 +76,6 @@ Microsoft.Extensions.Http.Polly.dll
Microsoft.Extensions.Identity.Core.dll
Microsoft.Extensions.Identity.Stores.dll
Microsoft.Extensions.Logging.Abstractions.dll
-Microsoft.Extensions.Logging.ApplicationInsights.dll
Microsoft.Extensions.Logging.AzureAppServices.dll
Microsoft.Extensions.Options.dll
Microsoft.Extensions.PlatformAbstractions.dll
@@ -165,7 +156,6 @@ System.Composition.Runtime.dll
System.Composition.TypedParts.dll
System.Configuration.ConfigurationManager.dll
System.Data.SqlClient.dll
-System.Diagnostics.PerformanceCounter.dll
System.Drawing.Common.dll
System.IdentityModel.Tokens.Jwt.dll
System.IO.Abstractions.dll
diff --git a/src/VirtoCommerce.Platform.Caching/Redis/RedisCachingOptions.cs b/src/VirtoCommerce.Platform.Caching/Redis/RedisCachingOptions.cs
index cf19e2cd5f1..46540c7b21e 100644
--- a/src/VirtoCommerce.Platform.Caching/Redis/RedisCachingOptions.cs
+++ b/src/VirtoCommerce.Platform.Caching/Redis/RedisCachingOptions.cs
@@ -1,12 +1,7 @@
-using System;
-
namespace VirtoCommerce.Platform.Redis
{
public class RedisCachingOptions
{
public string ChannelName { get; set; }
-
- [Obsolete("Use Redis connection string parameters for retry policy configration")]
- public int BusRetryCount { get; set; } = 3;
}
}
diff --git a/src/VirtoCommerce.Platform.Caching/VirtoCommerce.Platform.Caching.csproj b/src/VirtoCommerce.Platform.Caching/VirtoCommerce.Platform.Caching.csproj
index ab5581d2b54..78ecf8ac92d 100644
--- a/src/VirtoCommerce.Platform.Caching/VirtoCommerce.Platform.Caching.csproj
+++ b/src/VirtoCommerce.Platform.Caching/VirtoCommerce.Platform.Caching.csproj
@@ -2,7 +2,7 @@
net8.0
- 1591
+ 1591;NU5048
Library
True
true
diff --git a/src/VirtoCommerce.Platform.Core/Caching/MemoryCacheExtensions.cs b/src/VirtoCommerce.Platform.Core/Caching/MemoryCacheExtensions.cs
index 92c36de8cde..7b6f1fbd97f 100644
--- a/src/VirtoCommerce.Platform.Core/Caching/MemoryCacheExtensions.cs
+++ b/src/VirtoCommerce.Platform.Core/Caching/MemoryCacheExtensions.cs
@@ -29,7 +29,7 @@ public static async Task> GetOrLoadByIdsAsync(
if (!TryGetByIds(memoryCache, keyPrefix, ids, out var result))
{
- using (await AsyncLock.GetLockByKey(keyPrefix).GetReleaserAsync())
+ using (await AsyncLock.GetLockByKey(keyPrefix).LockAsync())
{
if (!TryGetByIds(memoryCache, keyPrefix, ids, out result))
{
@@ -96,7 +96,7 @@ public static async Task GetOrCreateExclusiveAsync(this IMemoryCac
{
if (!cache.TryGetValue(key, out var result))
{
- using (await AsyncLock.GetLockByKey(key).GetReleaserAsync())
+ using (await AsyncLock.GetLockByKey(key).LockAsync())
{
if (!cache.TryGetValue(key, out result))
{
diff --git a/src/VirtoCommerce.Platform.Core/Common/AsyncLock.cs b/src/VirtoCommerce.Platform.Core/Common/AsyncLock.cs
index 11d3886531c..5a34df250b9 100644
--- a/src/VirtoCommerce.Platform.Core/Common/AsyncLock.cs
+++ b/src/VirtoCommerce.Platform.Core/Common/AsyncLock.cs
@@ -16,9 +16,9 @@ public AsyncLock(string key)
_key = key;
}
- private static readonly Dictionary> _semaphoreSlims = new Dictionary>();
+ private static readonly Dictionary> _semaphoreSlims = new();
- private SemaphoreSlim GetOrCreate(string key)
+ private static SemaphoreSlim GetOrCreate(string key)
{
RefCounted item;
lock (_semaphoreSlims)
@@ -41,22 +41,19 @@ public static AsyncLock GetLockByKey(string key)
return new AsyncLock(key);
}
- // TODO: Rename to LockAsync after resolving problem with backward compatibility
- // in the modules (look on this ticket https://virtocommerce.atlassian.net/browse/PT-3548)
- public async Task GetReleaserAsync()
+ [Obsolete("Use LockAsync()", DiagnosticId = "VC0009", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions")]
+ public Task GetReleaserAsync()
{
- await GetOrCreate(_key).WaitAsync().ConfigureAwait(false);
- return new Releaser(_key);
+ return LockAsync();
}
- [Obsolete("Left for backward compatibility. Use GetReleaserAsync")]
- public async Task LockAsync()
+ public async Task LockAsync()
{
await GetOrCreate(_key).WaitAsync().ConfigureAwait(false);
return new Releaser(_key);
}
- public struct Releaser : IDisposable
+ public readonly struct Releaser : IDisposable
{
private readonly string _key;
@@ -90,7 +87,7 @@ public RefCounted(T value)
}
public int RefCount { get; set; }
- public T Value { get; private set; }
+ public T Value { get; }
}
}
}
diff --git a/src/VirtoCommerce.Platform.Core/Common/MigrationName.cs b/src/VirtoCommerce.Platform.Core/Common/MigrationName.cs
index 91a1b6c99f0..a6a343f5758 100644
--- a/src/VirtoCommerce.Platform.Core/Common/MigrationName.cs
+++ b/src/VirtoCommerce.Platform.Core/Common/MigrationName.cs
@@ -1,12 +1,10 @@
-using System;
-
namespace VirtoCommerce.Platform.Core.Common
{
public static class MigrationName
{
///
/// It's important thing of naming for correct migration to v.3
- /// The migration of update from v.2 should be apply at the first
+ /// The migration from v.2 should be applied first
///
///
/// 20000000000000_UpdateModuleNameV2
@@ -14,11 +12,5 @@ public static string GetUpdateV2MigrationName(string moduleName)
{
return $"20000000000000_Update{moduleName.Replace(".", "").Replace("VirtoCommerce", "")}V2";
}
-
- [Obsolete("use GetUpdateV2MigrationName")]
- public static string GetUpdateV2MigrationNameByOwnerName(string moduleName, string ownerName)
- {
- return GetUpdateV2MigrationName(moduleName);
- }
}
}
diff --git a/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertyDictionaryItemsSearchService.cs b/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertyDictionaryItemsSearchService.cs
index cdc7b0f3588..af88324d9e3 100644
--- a/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertyDictionaryItemsSearchService.cs
+++ b/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertyDictionaryItemsSearchService.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Threading.Tasks;
using VirtoCommerce.Platform.Core.GenericCrud;
namespace VirtoCommerce.Platform.Core.DynamicProperties
{
public interface IDynamicPropertyDictionaryItemsSearchService : ISearchService
{
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- Task SearchDictionaryItemsAsync(DynamicPropertyDictionaryItemSearchCriteria criteria);
}
}
diff --git a/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertySearchService.cs b/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertySearchService.cs
index 641a7c49b21..f62910a15af 100644
--- a/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertySearchService.cs
+++ b/src/VirtoCommerce.Platform.Core/DynamicProperties/IDynamicPropertySearchService.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Threading.Tasks;
using VirtoCommerce.Platform.Core.GenericCrud;
namespace VirtoCommerce.Platform.Core.DynamicProperties
{
public interface IDynamicPropertySearchService : ISearchService
{
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- Task SearchDynamicPropertiesAsync(DynamicPropertySearchCriteria criteria);
}
}
diff --git a/src/VirtoCommerce.Platform.Core/Exceptions/SettingsTypeNotRegisteredException.cs b/src/VirtoCommerce.Platform.Core/Exceptions/SettingsTypeNotRegisteredException.cs
deleted file mode 100644
index 6f2df978962..00000000000
--- a/src/VirtoCommerce.Platform.Core/Exceptions/SettingsTypeNotRegisteredException.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace VirtoCommerce.Platform.Core.Exceptions
-{
- [Obsolete("Not used in the platform, will be removed when migrating to a new version of .net")]
- public class SettingsTypeNotRegisteredException : PlatformException
- {
- public SettingsTypeNotRegisteredException(string settingsType)
- : base($"Settings for type: {settingsType} not registered, please register it first")
- {
- }
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Extensions/CrudServiceExtensions.cs b/src/VirtoCommerce.Platform.Core/Extensions/CrudServiceExtensions.cs
index 10d2c95faa4..70f0c27d8eb 100644
--- a/src/VirtoCommerce.Platform.Core/Extensions/CrudServiceExtensions.cs
+++ b/src/VirtoCommerce.Platform.Core/Extensions/CrudServiceExtensions.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -38,11 +37,4 @@ public static async Task GetByIdAsync(this ICrudService
return entities?.FirstOrDefault();
}
-
- [Obsolete("Use GetAsync() or GetNoCloneAsync()")]
- public static Task> GetByIdsAsync(this ICrudService crudService, IList ids, string responseGroup = null, bool clone = true)
- where TModel : Entity
- {
- return crudService.GetAsync(ids, responseGroup, clone);
- }
}
diff --git a/src/VirtoCommerce.Platform.Core/Extensions/SearchServiceExtensions.cs b/src/VirtoCommerce.Platform.Core/Extensions/SearchServiceExtensions.cs
index c97347b6bec..31a23bcabe6 100644
--- a/src/VirtoCommerce.Platform.Core/Extensions/SearchServiceExtensions.cs
+++ b/src/VirtoCommerce.Platform.Core/Extensions/SearchServiceExtensions.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -45,24 +44,6 @@ public static Task SearchNoCloneAsync(this
return searchService.SearchAsync(searchCriteria, clone: false);
}
- [Obsolete("Use SearchBatchesNoCloneAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public static IAsyncEnumerable SearchBatchesNoClone(this ISearchService searchService, TCriteria searchCriteria)
- where TCriteria : SearchCriteriaBase
- where TResult : GenericSearchResult
- where TModel : Entity, ICloneable
- {
- return searchService.SearchBatchesNoCloneAsync(searchCriteria);
- }
-
- [Obsolete("Use SearchBatchesAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public static IAsyncEnumerable SearchBatches(this ISearchService searchService, TCriteria searchCriteria, bool clone = true)
- where TCriteria : SearchCriteriaBase
- where TResult : GenericSearchResult
- where TModel : Entity, ICloneable
- {
- return searchService.SearchBatchesAsync(searchCriteria, clone);
- }
-
///
/// Returns data from the cache without cloning. This consumes less memory, but the returned data must not be modified.
///
diff --git a/src/VirtoCommerce.Platform.Core/Modularity/ModuleAttribute.cs b/src/VirtoCommerce.Platform.Core/Modularity/ModuleAttribute.cs
index 1bcd72142a1..4343d0f7063 100644
--- a/src/VirtoCommerce.Platform.Core/Modularity/ModuleAttribute.cs
+++ b/src/VirtoCommerce.Platform.Core/Modularity/ModuleAttribute.cs
@@ -15,25 +15,11 @@ public sealed class ModuleAttribute : Attribute
/// The name of the module.
public string ModuleName { get; set; }
- ///
- /// Gets or sets a value indicating whether the module should be loaded at startup.
- ///
- /// When (default value), it indicates that this module should be loaded at startup.
- /// Otherwise you should explicitly load this module on demand.
- /// A value.
- [Obsolete("StartupLoaded has been replaced by the OnDemand property.")]
- public bool StartupLoaded
- {
- get { return !OnDemand; }
- set { OnDemand = !value; }
- }
-
-
///
/// Gets or sets the value indicating whether the module should be loaded OnDemand.
///
/// When (default value), it indicates the module should be loaded as soon as it's dependencies are satisfied.
- /// Otherwise you should explicitily load this module via the ModuleManager.
+ /// Otherwise, you should explicitly load this module via the ModuleManager.
public bool OnDemand { get; set; }
}
}
diff --git a/src/VirtoCommerce.Platform.Core/Notifications/DefaultEmailSender.cs b/src/VirtoCommerce.Platform.Core/Notifications/DefaultEmailSender.cs
deleted file mode 100644
index 5904bb5e964..00000000000
--- a/src/VirtoCommerce.Platform.Core/Notifications/DefaultEmailSender.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Threading.Tasks;
-
-namespace VirtoCommerce.Platform.Core.Notifications
-{
- public class DefaultEmailSender : IEmailSender
- {
- public Task SendEmailAsync(string email, string subject, string message)
- {
- //nothing to do
- return Task.CompletedTask;
- }
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Notifications/IEmailSender.cs b/src/VirtoCommerce.Platform.Core/Notifications/IEmailSender.cs
deleted file mode 100644
index 34611efe366..00000000000
--- a/src/VirtoCommerce.Platform.Core/Notifications/IEmailSender.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-using System.Threading.Tasks;
-
-namespace VirtoCommerce.Platform.Core.Notifications
-{
- [Obsolete("Use notification module instead")]
- public interface IEmailSender
- {
- Task SendEmailAsync(string email, string subject, string message);
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/PlatformConstants.cs b/src/VirtoCommerce.Platform.Core/PlatformConstants.cs
index 6289b980999..26b10fa76f3 100644
--- a/src/VirtoCommerce.Platform.Core/PlatformConstants.cs
+++ b/src/VirtoCommerce.Platform.Core/PlatformConstants.cs
@@ -24,10 +24,12 @@ public static class Claims
public const string UserNameClaimType = "username";
public const string LimitedPermissionsClaimType = "limited_permissions";
public const string MemberIdClaimType = "memberId";
+
///
- /// Represents Operator User Id after impersonation
+ /// Represents Operator User ID after impersonation
///
public const string OperatorUserId = "vc_operator_user_id";
+
///
/// Represents Operator User Name after impersonation
///
@@ -45,42 +47,42 @@ public static class Permissions
{
public const string ResetCache = "cache:reset";
- public const string AssetAccess = "platform:asset:access",
- AssetDelete = "platform:asset:delete",
- AssetUpdate = "platform:asset:update",
- AssetCreate = "platform:asset:create",
- AssetRead = "platform:asset:read";
-
- public const string ModuleQuery = "platform:module:read",
- ModuleAccess = "platform:module:access",
- ModuleManage = "platform:module:manage";
-
- public const string SettingQuery = "platform:setting:read",
- SettingAccess = "platform:setting:access",
- SettingUpdate = "platform:setting:update";
-
- public const string DynamicPropertiesQuery = "platform:dynamic_properties:read",
- DynamicPropertiesCreate = "platform:dynamic_properties:create",
- DynamicPropertiesAccess = "platform:dynamic_properties:access",
- DynamicPropertiesUpdate = "platform:dynamic_properties:update",
- DynamicPropertiesDelete = "platform:dynamic_properties:delete";
-
- public const string SecurityQuery = "platform:security:read",
- SecurityCreate = "platform:security:create",
- SecurityAccess = "platform:security:access",
- SecurityUpdate = "platform:security:update",
- SecurityDelete = "platform:security:delete",
- SecurityVerifyEmail = "platform:security:verifyEmail",
- SecurityLoginOnBehalf = "platform:security:loginOnBehalf",
- SecurityConfirmEmail = "platform:security:confirmEmail",
- SecurityGenerateToken = "platform:security:generateToken",
- SecurityVerifyToken = "platform:security:verifyToken";
+ public const string AssetAccess = "platform:asset:access";
+ public const string AssetDelete = "platform:asset:delete";
+ public const string AssetUpdate = "platform:asset:update";
+ public const string AssetCreate = "platform:asset:create";
+ public const string AssetRead = "platform:asset:read";
+
+ public const string ModuleQuery = "platform:module:read";
+ public const string ModuleAccess = "platform:module:access";
+ public const string ModuleManage = "platform:module:manage";
+
+ public const string SettingQuery = "platform:setting:read";
+ public const string SettingAccess = "platform:setting:access";
+ public const string SettingUpdate = "platform:setting:update";
+
+ public const string DynamicPropertiesQuery = "platform:dynamic_properties:read";
+ public const string DynamicPropertiesCreate = "platform:dynamic_properties:create";
+ public const string DynamicPropertiesAccess = "platform:dynamic_properties:access";
+ public const string DynamicPropertiesUpdate = "platform:dynamic_properties:update";
+ public const string DynamicPropertiesDelete = "platform:dynamic_properties:delete";
+
+ public const string SecurityQuery = "platform:security:read";
+ public const string SecurityCreate = "platform:security:create";
+ public const string SecurityAccess = "platform:security:access";
+ public const string SecurityUpdate = "platform:security:update";
+ public const string SecurityDelete = "platform:security:delete";
+ public const string SecurityVerifyEmail = "platform:security:verifyEmail";
+ public const string SecurityLoginOnBehalf = "platform:security:loginOnBehalf";
+ public const string SecurityConfirmEmail = "platform:security:confirmEmail";
+ public const string SecurityGenerateToken = "platform:security:generateToken";
+ public const string SecurityVerifyToken = "platform:security:verifyToken";
public const string BackgroundJobsManage = "background_jobs:manage";
- public const string PlatformExportImportAccess = "platform:exportImport:access",
- PlatformImport = "platform:import",
- PlatformExport = "platform:export";
+ public const string PlatformExportImportAccess = "platform:exportImport:access";
+ public const string PlatformImport = "platform:import";
+ public const string PlatformExport = "platform:export";
public static string[] AllPermissions { get; } = new[] { ResetCache, AssetAccess, AssetDelete, AssetUpdate, AssetCreate, AssetRead, ModuleQuery, ModuleAccess, ModuleManage,
SettingQuery, SettingAccess, SettingUpdate, DynamicPropertiesQuery, DynamicPropertiesCreate, DynamicPropertiesAccess, DynamicPropertiesUpdate, DynamicPropertiesDelete,
@@ -447,21 +449,6 @@ public static IEnumerable AllSettings
}
}
- public static class Other
- {
- [Obsolete("Use PlatformConstants.Settings.Security.AccountStatuses", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public static SettingDescriptor AccountStatuses => Security.AccountStatuses;
-
- [Obsolete("Use PlatformConstants.Settings.Security.AllSettings", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public static IEnumerable AllSettings
- {
- get
- {
- yield return AccountStatuses;
- }
- }
- }
-
public static IEnumerable AllSettings =>
General.AllGeneralSettings
.Concat(Security.AllSettings)
diff --git a/src/VirtoCommerce.Platform.Core/Security/AccountState.cs b/src/VirtoCommerce.Platform.Core/Security/AccountState.cs
deleted file mode 100644
index 880dc513ed3..00000000000
--- a/src/VirtoCommerce.Platform.Core/Security/AccountState.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace VirtoCommerce.Platform.Core.Security
-{
- ///
- /// Obsolete. Left due to compatibility issues. Will be removed. Instead of, use: ApplicationUser.EmailConfirmed, ApplicationUser.LockoutEnd.
- ///
- public enum AccountState
- {
- PendingApproval,
- Approved,
- Rejected
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Security/ApplicationUser.cs b/src/VirtoCommerce.Platform.Core/Security/ApplicationUser.cs
index d429efacc00..c798269d9f5 100644
--- a/src/VirtoCommerce.Platform.Core/Security/ApplicationUser.cs
+++ b/src/VirtoCommerce.Platform.Core/Security/ApplicationUser.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Identity;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.Platform.Core.Utils.ChangeDetector;
@@ -16,17 +14,17 @@ public class ApplicationUser : IdentityUser, IEntity, IAuditable, ICloneable
///
public virtual string StoreId { get; set; }
- [DetectChangesAttribute(PlatformConstants.Security.Changes.UserUpdated)]
+ [DetectChanges(PlatformConstants.Security.Changes.UserUpdated)]
public virtual string MemberId { get; set; }
- [DetectChangesAttribute(PlatformConstants.Security.Changes.UserUpdated)]
+ [DetectChanges(PlatformConstants.Security.Changes.UserUpdated)]
public virtual bool IsAdministrator { get; set; }
public virtual string PhotoUrl { get; set; }
- [DetectChangesAttribute(PlatformConstants.Security.Changes.UserUpdated)]
+ [DetectChanges(PlatformConstants.Security.Changes.UserUpdated)]
public virtual string UserType { get; set; }
- [DetectChangesAttribute(PlatformConstants.Security.Changes.UserUpdated)]
+ [DetectChanges(PlatformConstants.Security.Changes.UserUpdated)]
public virtual string Status { get; set; }
public virtual string Password { get; set; }
public virtual DateTime CreatedDate { get; set; }
@@ -38,32 +36,6 @@ public class ApplicationUser : IdentityUser, IEntity, IAuditable, ICloneable
[SwaggerIgnore]
public virtual ICollection> UserRoles { get; set; }
- ///
- /// Obsolete. Use LockoutEnd. DateTime in UTC when lockout ends, any time in the past is considered not locked out.
- ///
- [Obsolete("Left due to compatibility issues. Use LockoutEnd")]
- public virtual DateTime? LockoutEndDateUtc
- {
- get
- {
- return LockoutEnd?.UtcDateTime;
- }
- set
- {
- LockoutEnd = value;
- }
- }
-
- [Obsolete("Left due to compatibility issues. Will be removed. Instead of, use properties: EmailConfirmed, LockoutEnd.")]
- [JsonConverter(typeof(StringEnumConverter))]
- public virtual AccountState UserState { get; set; }
-
- ///
- /// Obsolete. All permissions from assigned roles.
- ///
- [Obsolete("Left due to compatibility issues")]
- public virtual string[] Permissions { get; set; }
-
///
/// External provider logins.
///
@@ -104,7 +76,6 @@ public virtual void Patch(ApplicationUser target)
target.TwoFactorEnabled = TwoFactorEnabled;
target.LockoutEnabled = LockoutEnabled;
target.LockoutEnd = LockoutEnd;
- target.UserState = UserState;
target.AccessFailedCount = AccessFailedCount;
target.MemberId = MemberId;
@@ -158,7 +129,7 @@ public virtual ListDictionary DetectUserChanges(ApplicationUser
public virtual object Clone()
{
- var result = MemberwiseClone() as ApplicationUser;
+ var result = (ApplicationUser)MemberwiseClone();
result.Roles = Roles?.Select(x => x.Clone()).OfType().ToList();
diff --git a/src/VirtoCommerce.Platform.Core/Security/IUserPasswordHasher.cs b/src/VirtoCommerce.Platform.Core/Security/IUserPasswordHasher.cs
deleted file mode 100644
index f16c9ab28c2..00000000000
--- a/src/VirtoCommerce.Platform.Core/Security/IUserPasswordHasher.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using Microsoft.AspNetCore.Identity;
-
-namespace VirtoCommerce.Platform.Core.Security
-{
- ///
- /// Basic interface for platform password hashers
- ///
- [Obsolete("Use IPasswordHasher instead. UserPasswordsHistory is available from ISecurityRepository")]
- public interface IUserPasswordHasher : IPasswordHasher
- {
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Security/Permission.cs b/src/VirtoCommerce.Platform.Core/Security/Permission.cs
index dd98e4d8897..51b37a80b0b 100644
--- a/src/VirtoCommerce.Platform.Core/Security/Permission.cs
+++ b/src/VirtoCommerce.Platform.Core/Security/Permission.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
@@ -7,25 +6,10 @@
namespace VirtoCommerce.Platform.Core.Security
{
- public class Permission : ValueObject, ICloneable
+ public class Permission : ValueObject
{
private const char _scopeCharSeparator = '|';
- [Obsolete("Left for backward compatibility")]
- public string Id
- {
- get
- {
- return Name;
- }
-#pragma warning disable S3237 // "value" parameters should be used
- set
-#pragma warning restore S3237 // "value" parameters should be used
- {
- // Do not remove this empty set-accessor! It is needed for backward compatibility.
- }
- }
-
public string Name { get; set; }
///
/// Id of the module which has registered this permission.
@@ -98,7 +82,7 @@ public virtual void Patch(Permission target)
#region ICloneable members
public override object Clone()
{
- var result = MemberwiseClone() as Permission;
+ var result = (Permission)MemberwiseClone();
result.AssignedScopes = AssignedScopes?.Select(x => x.Clone()).OfType().ToList();
diff --git a/src/VirtoCommerce.Platform.Core/Security/Search/IUserApiKeySearchService.cs b/src/VirtoCommerce.Platform.Core/Security/Search/IUserApiKeySearchService.cs
index be491359645..92cbc2e5117 100644
--- a/src/VirtoCommerce.Platform.Core/Security/Search/IUserApiKeySearchService.cs
+++ b/src/VirtoCommerce.Platform.Core/Security/Search/IUserApiKeySearchService.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Threading.Tasks;
using VirtoCommerce.Platform.Core.GenericCrud;
namespace VirtoCommerce.Platform.Core.Security.Search
{
public interface IUserApiKeySearchService : ISearchService
{
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- Task SearchUserApiKeysAsync(UserApiKeySearchCriteria criteria);
}
}
diff --git a/src/VirtoCommerce.Platform.Core/Settings/ISettingsSearchService.cs b/src/VirtoCommerce.Platform.Core/Settings/ISettingsSearchService.cs
index 9d44c5e2de8..ac8af5c62cc 100644
--- a/src/VirtoCommerce.Platform.Core/Settings/ISettingsSearchService.cs
+++ b/src/VirtoCommerce.Platform.Core/Settings/ISettingsSearchService.cs
@@ -1,13 +1,8 @@
-using System;
-using System.Threading.Tasks;
-using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.Platform.Core.GenericCrud;
namespace VirtoCommerce.Platform.Core.Settings
{
public interface ISettingsSearchService : ISearchService
{
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- Task> SearchSettingsAsync(SettingsSearchCriteria searchCriteria);
}
}
diff --git a/src/VirtoCommerce.Platform.Core/Settings/SettingsExtension.cs b/src/VirtoCommerce.Platform.Core/Settings/SettingsExtension.cs
index 7f3a6b04bc7..3d53f683ea4 100644
--- a/src/VirtoCommerce.Platform.Core/Settings/SettingsExtension.cs
+++ b/src/VirtoCommerce.Platform.Core/Settings/SettingsExtension.cs
@@ -120,18 +120,6 @@ public static async Task DeepRemoveSettingsAsync(this ISettingsManager manager,
await manager.RemoveObjectSettingsAsync(foDeleteSettings);
}
- [Obsolete("Use GetValue<>(SettingDescriptor)")]
- public static TValue GetValueByDescriptor(this ISettingsManager manager, SettingDescriptor descriptor)
- {
- return manager.GetValueAsync(descriptor).GetAwaiter().GetResult();
- }
-
- [Obsolete("Use GetValueAsync<>(SettingDescriptor)")]
- public static Task GetValueByDescriptorAsync(this ISettingsManager manager, SettingDescriptor descriptor)
- {
- return manager.GetValueAsync(descriptor);
- }
-
///
/// Takes default value from the setting descriptor
///
@@ -155,18 +143,6 @@ public static Task GetValueAsync(this ISettingsManager manager,
return manager.GetValueInternalAsync(descriptor.Name, defaultValue);
}
- [Obsolete("Use GetValue<>(SettingDescriptor)")]
- public static T GetValue(this ISettingsManager manager, string name, T defaultValue)
- {
- return manager.GetValueInternalAsync(name, defaultValue).GetAwaiter().GetResult();
- }
-
- [Obsolete("Use GetValueAsync<>(SettingDescriptor)")]
- public static Task GetValueAsync(this ISettingsManager manager, string name, T defaultValue)
- {
- return manager.GetValueInternalAsync(name, defaultValue);
- }
-
private static async Task GetValueInternalAsync(this ISettingsManager manager, string name, T defaultValue)
{
var result = defaultValue;
@@ -211,12 +187,6 @@ public static TValue GetValue(this IEnumerable objec
return objectSettings.GetValueInternal(descriptor.Name, defaultValue);
}
- [Obsolete("Use GetValue<>(SettingDescriptor)", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public static T GetSettingValue(this IEnumerable objectSettings, string settingName, T defaultValue)
- {
- return objectSettings.GetValueInternal(settingName, defaultValue);
- }
-
private static T GetValueInternal(this IEnumerable objectSettings, string settingName, T defaultValue)
{
var retVal = defaultValue;
diff --git a/src/VirtoCommerce.Platform.Core/Swagger/SwaggerPlatformOptions.cs b/src/VirtoCommerce.Platform.Core/Swagger/SwaggerPlatformOptions.cs
index 3e6d09da2dd..712a659789f 100644
--- a/src/VirtoCommerce.Platform.Core/Swagger/SwaggerPlatformOptions.cs
+++ b/src/VirtoCommerce.Platform.Core/Swagger/SwaggerPlatformOptions.cs
@@ -1,21 +1,10 @@
-using System;
-
namespace VirtoCommerce.Platform.Core.Swagger
{
public class SwaggerPlatformOptions
{
///
- /// Disable swagger at the startup (switch off endpoints for swagger UI and docs)
+ /// Enable (default) or disable swagger at the startup (switch off endpoints for swagger UI and docs)
///
- [Obsolete("Use Enable", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public bool Disable
- {
- get => !Enable;
- set => Enable = !value;
- }
-
- // We want the Enable property to have a higher priority than Disable,
- // so Enable should come after the Disable because of the implementation details of IConfiguration.Bind().
public bool Enable { get; set; } = true;
}
}
diff --git a/src/VirtoCommerce.Platform.Core/Telemetry/ApplicationInsightsOptions.cs b/src/VirtoCommerce.Platform.Core/Telemetry/ApplicationInsightsOptions.cs
deleted file mode 100644
index e90f4a8f060..00000000000
--- a/src/VirtoCommerce.Platform.Core/Telemetry/ApplicationInsightsOptions.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-
-namespace VirtoCommerce.Platform.Core.Telemetry
-{
-
- ///
- /// ApplicationInsights options
- ///
- [Obsolete("Not used anymore. Moved to VirtoCommerce.ApplicationInsights module.")]
- public class ApplicationInsightsOptions
- {
- ///
- /// AppInsights sampling options
- ///
- public SamplingOptions SamplingOptions { get; set; } = new SamplingOptions();
-
- ///
- /// Enable SQL dependencies filtering ApplicationInsights processor
- ///
- public IgnoreSqlTelemetryOptions IgnoreSqlTelemetryOptions { get; set; }
-
- ///
- /// Force SQL reflection in dependencies for ApplicationInsights
- ///
- public bool EnableLocalSqlCommandTextInstrumentation { get; set; }
-
- ///
- /// Same as EnableLocalSqlCommandTextInstrumentation
- ///
- public bool EnableSqlCommandTextInstrumentation { get; set; }
-
- ///
- /// Cloud Role Name
- ///
- public string RoleName { get; set; }
-
- ///
- /// Cloud Role Instance
- ///
- public string RoleInstance { get; set; }
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Telemetry/FixedProcessorSettings.cs b/src/VirtoCommerce.Platform.Core/Telemetry/FixedProcessorSettings.cs
deleted file mode 100644
index d313ba1b55a..00000000000
--- a/src/VirtoCommerce.Platform.Core/Telemetry/FixedProcessorSettings.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-namespace VirtoCommerce.Platform.Core.Telemetry
-{
- ///
- /// AppInsights settings for fixed sampling
- ///
- [Obsolete("Not used anymore. Moved to VirtoCommerce.ApplicationInsights module.")]
- public class FixedProcessorSettings
- {
- ///
- /// Data sampling percentage (between 0 and 100).
- /// All sampling percentage must be in a ratio of 100/N where N is a whole number (2, 3, 4, …). E.g. 50 for 1/2 or 33.33 for 1/3.
- /// Failure to follow this pattern can result in unexpected / incorrect computation of values in the portal.
- ///
- public double SamplingPercentage { get; set; } = 100;
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Telemetry/IgnoreSQLTelemetryOptions.cs b/src/VirtoCommerce.Platform.Core/Telemetry/IgnoreSQLTelemetryOptions.cs
deleted file mode 100644
index 086cb98c4eb..00000000000
--- a/src/VirtoCommerce.Platform.Core/Telemetry/IgnoreSQLTelemetryOptions.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace VirtoCommerce.Platform.Core.Telemetry
-{
- [Obsolete("Not used anymore. Moved to VirtoCommerce.ApplicationInsights module.")]
- public class IgnoreSqlTelemetryOptions
- {
- public string[] QueryIgnoreSubstrings { get; set; } = new string[] { };
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Telemetry/SamplingOptions.cs b/src/VirtoCommerce.Platform.Core/Telemetry/SamplingOptions.cs
deleted file mode 100644
index 17597b59903..00000000000
--- a/src/VirtoCommerce.Platform.Core/Telemetry/SamplingOptions.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using Microsoft.ApplicationInsights.WindowsServer.Channel.Implementation;
-
-namespace VirtoCommerce.Platform.Core.Telemetry
-{
- ///
- /// AppInsights sampling options
- ///
- [Obsolete("Not used anymore. Moved to VirtoCommerce.ApplicationInsights module.")]
- public class SamplingOptions
- {
- ///
- /// Type of sampling processor: adaptive or fixed. See https://docs.microsoft.com/en-us/azure/azure-monitor/app/sampling
- ///
- public SamplingProcessor Processor { get; set; } = SamplingProcessor.Adaptive;
- ///
- /// Adaptive sampling settings (if Processor==SamplingProcessor.Adaptive)
- ///
- public SamplingPercentageEstimatorSettings Adaptive { get; set; } = new SamplingPercentageEstimatorSettings();
- ///
- /// Fixed sampling settings (if Processor==SamplingProcessor.Fixed)
- ///
- public FixedProcessorSettings Fixed { get; set; } = new FixedProcessorSettings();
- ///
- /// A semi-colon delimited list of types that you do want to subject to sampling.
- /// Recognized types are: Dependency, Event, Exception, PageView, Request, Trace. The specified types will be sampled.
- /// All types included by default.
- ///
- public string IncludedTypes { get; set; } = "Dependency;Event;Exception;PageView;Request;Trace";
- ///
- /// A semi-colon delimited list of types that you do not want to be subject to sampling.
- /// Recognized types are: Dependency, Event, Exception, PageView, Request, Trace.
- /// Empty by default.
- ///
- public string ExcludedTypes { get; set; }
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/Telemetry/SamplingProcessor.cs b/src/VirtoCommerce.Platform.Core/Telemetry/SamplingProcessor.cs
deleted file mode 100644
index 42fcc056106..00000000000
--- a/src/VirtoCommerce.Platform.Core/Telemetry/SamplingProcessor.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-
-namespace VirtoCommerce.Platform.Core.Telemetry
-{
- [Obsolete("Not used anymore. Moved to VirtoCommerce.ApplicationInsights module.")]
- public enum SamplingProcessor
- {
- Adaptive,
- Fixed
- }
-}
diff --git a/src/VirtoCommerce.Platform.Core/VirtoCommerce.Platform.Core.csproj b/src/VirtoCommerce.Platform.Core/VirtoCommerce.Platform.Core.csproj
index 6ffc7c99c9b..1f08ecadf52 100644
--- a/src/VirtoCommerce.Platform.Core/VirtoCommerce.Platform.Core.csproj
+++ b/src/VirtoCommerce.Platform.Core/VirtoCommerce.Platform.Core.csproj
@@ -2,7 +2,7 @@
net8.0
- 1591
+ 1591;NU5048
Library
True
@@ -23,11 +23,10 @@
-
-
+
diff --git a/src/VirtoCommerce.Platform.Data.MySql/MySqlCertificateLoader.cs b/src/VirtoCommerce.Platform.Data.MySql/MySqlCertificateLoader.cs
index dbce4527cc8..58b8719e731 100644
--- a/src/VirtoCommerce.Platform.Data.MySql/MySqlCertificateLoader.cs
+++ b/src/VirtoCommerce.Platform.Data.MySql/MySqlCertificateLoader.cs
@@ -17,7 +17,8 @@ public MySqlCertificateLoader(IConfiguration configuration)
protected virtual string GetConnectionString()
{
return _configuration["Auth:ConnectionString"] ??
- _configuration.GetConnectionString("VirtoCommerce");
+ _configuration.GetConnectionString("VirtoCommerce") ??
+ string.Empty;
}
///
diff --git a/src/VirtoCommerce.Platform.Data.MySql/VirtoCommerce.Platform.Data.MySql.csproj b/src/VirtoCommerce.Platform.Data.MySql/VirtoCommerce.Platform.Data.MySql.csproj
index 435345ef9f0..124cc8e90ce 100644
--- a/src/VirtoCommerce.Platform.Data.MySql/VirtoCommerce.Platform.Data.MySql.csproj
+++ b/src/VirtoCommerce.Platform.Data.MySql/VirtoCommerce.Platform.Data.MySql.csproj
@@ -4,10 +4,11 @@
net8.0
enable
enable
+ NU5048
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/VirtoCommerce.Platform.Data.PostgreSql/PostgreSqlCertificateLoader.cs b/src/VirtoCommerce.Platform.Data.PostgreSql/PostgreSqlCertificateLoader.cs
index 53e50455b9f..84d7a6d9579 100644
--- a/src/VirtoCommerce.Platform.Data.PostgreSql/PostgreSqlCertificateLoader.cs
+++ b/src/VirtoCommerce.Platform.Data.PostgreSql/PostgreSqlCertificateLoader.cs
@@ -17,7 +17,8 @@ public PostgreSqlCertificateLoader(IConfiguration configuration)
protected virtual string GetConnectionString()
{
return _configuration["Auth:ConnectionString"] ??
- _configuration.GetConnectionString("VirtoCommerce");
+ _configuration.GetConnectionString("VirtoCommerce") ??
+ string.Empty;
}
///
diff --git a/src/VirtoCommerce.Platform.Data.PostgreSql/VirtoCommerce.Platform.Data.PostgreSql.csproj b/src/VirtoCommerce.Platform.Data.PostgreSql/VirtoCommerce.Platform.Data.PostgreSql.csproj
index 188063f9376..eb478ffd9c1 100644
--- a/src/VirtoCommerce.Platform.Data.PostgreSql/VirtoCommerce.Platform.Data.PostgreSql.csproj
+++ b/src/VirtoCommerce.Platform.Data.PostgreSql/VirtoCommerce.Platform.Data.PostgreSql.csproj
@@ -4,10 +4,11 @@
net8.0
enable
enable
+ NU5048
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/VirtoCommerce.Platform.Data.SqlServer/SqlServerCertificateLoader.cs b/src/VirtoCommerce.Platform.Data.SqlServer/SqlServerCertificateLoader.cs
index 7a20cf68785..dd2a8fc3e72 100644
--- a/src/VirtoCommerce.Platform.Data.SqlServer/SqlServerCertificateLoader.cs
+++ b/src/VirtoCommerce.Platform.Data.SqlServer/SqlServerCertificateLoader.cs
@@ -1,8 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using VirtoCommerce.Platform.Core.Security;
@@ -22,7 +17,8 @@ public SqlServerCertificateLoader(IConfiguration configuration)
protected virtual string GetConnectionString()
{
return _configuration["Auth:ConnectionString"] ??
- _configuration.GetConnectionString("VirtoCommerce");
+ _configuration.GetConnectionString("VirtoCommerce") ??
+ string.Empty;
}
///
@@ -36,7 +32,7 @@ protected virtual bool CheckDatabaseExist(string sourceConnectionString)
var dbName = builder.InitialCatalog; // Catch database name to search from the connection string
builder.Remove("Initial Catalog"); // Initial catalog should be removed from connection string, otherwise the connection could not be opened
const string cmdCheckDb =
- @"select 1 from [sys].[databases] where name=@dbname";
+ "select 1 from [sys].[databases] where name=@dbname";
var connectionString = builder.ConnectionString;
using var conn = new SqlConnection(connectionString);
@@ -61,7 +57,7 @@ public ServerCertificate Load()
if (CheckDatabaseExist(connectionString))
{
const string cmdCheckMigration =
- @"select 1 from [sys].[tables] where name='ServerCertificate'";
+ "select 1 from [sys].[tables] where name='ServerCertificate'";
const string cmdServerCert =
@"SELECT TOP (1) [Id]
@@ -106,7 +102,7 @@ public ServerCertificate Load()
// If there is no certificate in DB and certificate is present in files
// then load from files.
- // Otherwise left it empty with default virto-cert number.
+ // Otherwise, left it empty with default virto-cert number.
// Default certificate will be replaced later by self-signed
if (!result.StoredInDb &&
!string.IsNullOrEmpty(publicCertPath) &&
diff --git a/src/VirtoCommerce.Platform.Data.SqlServer/VirtoCommerce.Platform.Data.SqlServer.csproj b/src/VirtoCommerce.Platform.Data.SqlServer/VirtoCommerce.Platform.Data.SqlServer.csproj
index 795659f0db1..ac13b2e61e4 100644
--- a/src/VirtoCommerce.Platform.Data.SqlServer/VirtoCommerce.Platform.Data.SqlServer.csproj
+++ b/src/VirtoCommerce.Platform.Data.SqlServer/VirtoCommerce.Platform.Data.SqlServer.csproj
@@ -4,13 +4,14 @@
net8.0
enable
enable
+ NU5048
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertyDictionaryItemsSearchService.cs b/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertyDictionaryItemsSearchService.cs
index 4a78b38d41d..67edec5569b 100644
--- a/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertyDictionaryItemsSearchService.cs
+++ b/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertyDictionaryItemsSearchService.cs
@@ -24,12 +24,6 @@ public DynamicPropertyDictionaryItemsSearchService(Func rep
_dynamicPropertyDictionaryItemsService = dynamicPropertyDictionaryItemsService;
}
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public virtual Task SearchDictionaryItemsAsync(DynamicPropertyDictionaryItemSearchCriteria criteria)
- {
- return SearchAsync(criteria, clone: true);
- }
-
public virtual async Task SearchAsync(DynamicPropertyDictionaryItemSearchCriteria criteria, bool clone = true)
{
var cacheKey = CacheKey.With(GetType(), "SearchDictionaryItemsAsync", criteria.GetHashCode().ToString());
diff --git a/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertySearchService.cs b/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertySearchService.cs
index ec4bd6eadc6..c2cf8a14d7c 100644
--- a/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertySearchService.cs
+++ b/src/VirtoCommerce.Platform.Data/DynamicProperties/DynamicPropertySearchService.cs
@@ -24,16 +24,6 @@ public DynamicPropertySearchService(Func repositoryFactory,
_memoryCache = memoryCache;
}
-
- #region IDynamicPropertySearchService members
-
-
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public virtual Task SearchDynamicPropertiesAsync(DynamicPropertySearchCriteria criteria)
- {
- return SearchAsync(criteria, clone: true);
- }
-
public Task SearchAsync(DynamicPropertySearchCriteria criteria, bool clone = true)
{
var cacheKey = CacheKey.With(GetType(), "SearchDynamicPropertiesAsync", criteria.GetCacheKey());
@@ -86,6 +76,5 @@ public Task SearchAsync(DynamicPropertySearchCriter
return result;
});
}
- #endregion
}
}
diff --git a/src/VirtoCommerce.Platform.Data/ExportImport/JsonSerializerExtensions.cs b/src/VirtoCommerce.Platform.Data/ExportImport/JsonSerializerExtensions.cs
deleted file mode 100644
index abe913ea7ca..00000000000
--- a/src/VirtoCommerce.Platform.Data/ExportImport/JsonSerializerExtensions.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using VirtoCommerce.Platform.Core.Common;
-
-namespace VirtoCommerce.Platform.Data.ExportImport
-{
- public static class JsonSerializerExtensions
- {
- public const int DefaultPageSize = 50;
-
- [Obsolete("Use VirtoCommerce.Platform.Core.ExportImport.JsonSerializerExtensions.SerializeArrayWithPagingAsync()")]
- public static async Task SerializeJsonArrayWithPagingAsync(this JsonTextWriter writer, JsonSerializer serializer, int pageSize, Func>> pagedDataLoader, Action progressCallback, ICancellationToken cancellationToken)
- {
- //Evaluate total items counts
- var result = await pagedDataLoader(0, 1);
-
- var totalCount = result.TotalCount;
-
- await writer.WriteStartArrayAsync();
-
- // Prevent infinity loop
- if (pageSize <= 0)
- {
- pageSize = DefaultPageSize;
- }
-
- for (var i = 0; i < totalCount; i += pageSize)
- {
- var nextPage = await pagedDataLoader(i, pageSize);
- foreach (var data in nextPage.Results)
- {
- cancellationToken.ThrowIfCancellationRequested();
- serializer.Serialize(writer, data);
- }
- await writer.FlushAsync();
- progressCallback(Math.Min(totalCount, i + pageSize), totalCount);
- }
- await writer.WriteEndArrayAsync();
- }
-
- [Obsolete("Use VirtoCommerce.Platform.Core.ExportImport.JsonSerializerExtensions.DeserializeArrayWithPagingAsync()")]
- public static async Task DeserializeJsonArrayWithPagingAsync(this JsonTextReader reader, JsonSerializer serializer, int pageSize, Func, Task> action, Action progressCallback, ICancellationToken cancellationToken)
- {
- await reader.ReadAsync();
- if (reader.TokenType == JsonToken.StartArray)
- {
- await reader.ReadAsync();
-
- var items = new List();
- var processedCount = 0;
- while (reader.TokenType != JsonToken.EndArray)
- {
- cancellationToken.ThrowIfCancellationRequested();
-
- var item = serializer.Deserialize(reader);
- items.Add(item);
- processedCount++;
- await reader.ReadAsync();
- if (processedCount % pageSize == 0 || reader.TokenType == JsonToken.EndArray)
- {
- await action(items);
- items.Clear();
- progressCallback(processedCount);
- }
- }
- }
- }
- }
-}
diff --git a/src/VirtoCommerce.Platform.Data/Extensions/ServiceCollectionExtensions.cs b/src/VirtoCommerce.Platform.Data/Extensions/ServiceCollectionExtensions.cs
index e8e3cd76ef6..b7bbe61724e 100644
--- a/src/VirtoCommerce.Platform.Data/Extensions/ServiceCollectionExtensions.cs
+++ b/src/VirtoCommerce.Platform.Data/Extensions/ServiceCollectionExtensions.cs
@@ -10,7 +10,6 @@
using VirtoCommerce.Platform.Core.ExportImport;
using VirtoCommerce.Platform.Core.GenericCrud;
using VirtoCommerce.Platform.Core.Localizations;
-using VirtoCommerce.Platform.Core.Notifications;
using VirtoCommerce.Platform.Core.TransactionFileManager;
using VirtoCommerce.Platform.Core.ZipFile;
using VirtoCommerce.Platform.Data.ChangeLog;
@@ -52,9 +51,6 @@ public static IServiceCollection AddPlatformServices(this IServiceCollection ser
services.AddScoped();
services.AddSingleton();
- services.AddTransient();
-
-
//Register dependencies for translation
services.AddSingleton();
services.AddSingleton();
diff --git a/src/VirtoCommerce.Platform.Data/Settings/SettingsSearchService.cs b/src/VirtoCommerce.Platform.Data/Settings/SettingsSearchService.cs
index ccd1be2c353..65c7d1c2d69 100644
--- a/src/VirtoCommerce.Platform.Data/Settings/SettingsSearchService.cs
+++ b/src/VirtoCommerce.Platform.Data/Settings/SettingsSearchService.cs
@@ -1,4 +1,3 @@
-using System;
using System.Linq;
using System.Threading.Tasks;
using VirtoCommerce.Platform.Core.Common;
@@ -15,12 +14,6 @@ public SettingsSearchService(ISettingsManager settingsManager)
_settingsManager = settingsManager;
}
- [Obsolete("Use SearchAsync()", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
- public async Task> SearchSettingsAsync(SettingsSearchCriteria criteria)
- {
- return await SearchAsync(criteria, clone: true);
- }
-
public async Task SearchAsync(SettingsSearchCriteria criteria, bool clone = true)
{
var result = AbstractTypeFactory.TryCreateInstance();
diff --git a/src/VirtoCommerce.Platform.Data/VirtoCommerce.Platform.Data.csproj b/src/VirtoCommerce.Platform.Data/VirtoCommerce.Platform.Data.csproj
index 40b93a21c10..fa5ee3a087b 100644
--- a/src/VirtoCommerce.Platform.Data/VirtoCommerce.Platform.Data.csproj
+++ b/src/VirtoCommerce.Platform.Data/VirtoCommerce.Platform.Data.csproj
@@ -2,7 +2,7 @@
net8.0
- 1591
+ 1591;NU5048
Library
True
true
@@ -21,11 +21,11 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/src/VirtoCommerce.Platform.DistributedLock/VirtoCommerce.Platform.DistributedLock.csproj b/src/VirtoCommerce.Platform.DistributedLock/VirtoCommerce.Platform.DistributedLock.csproj
index 6eb38d99e5d..d7288484130 100644
--- a/src/VirtoCommerce.Platform.DistributedLock/VirtoCommerce.Platform.DistributedLock.csproj
+++ b/src/VirtoCommerce.Platform.DistributedLock/VirtoCommerce.Platform.DistributedLock.csproj
@@ -2,7 +2,7 @@
net8.0
- 1591
+ 1591;NU5048
Library
True
diff --git a/src/VirtoCommerce.Platform.Hangfire/Extensions/ApplicationBuilderExtensions.cs b/src/VirtoCommerce.Platform.Hangfire/Extensions/ApplicationBuilderExtensions.cs
index d1aefdb3d3b..e6328509191 100644
--- a/src/VirtoCommerce.Platform.Hangfire/Extensions/ApplicationBuilderExtensions.cs
+++ b/src/VirtoCommerce.Platform.Hangfire/Extensions/ApplicationBuilderExtensions.cs
@@ -27,7 +27,7 @@ public static IApplicationBuilder UseHangfire(this IApplicationBuilder appBuilde
// This is an important workaround of Hangfire initialization issues
// The standard database schema initialization way described at the page https://docs.hangfire.io/en/latest/configuration/using-sql-server.html works on an existing database only.
- // Therefore we create SqlServerStorage for Hangfire manually here.
+ // Therefore, we create SqlServerStorage for Hangfire manually here.
// This way we ensure Hangfire schema will be applied to storage AFTER platform database creation.
var hangfireOptions = appBuilder.ApplicationServices.GetRequiredService>().Value;
if (hangfireOptions.JobStorageType == HangfireJobStorageType.SqlServer ||
@@ -40,19 +40,20 @@ public static IApplicationBuilder UseHangfire(this IApplicationBuilder appBuilde
switch (databaseProvider)
{
case "PostgreSql":
- storage = new PostgreSqlStorage(connectionString, hangfireOptions.PostgreSqlStorageOptions);
+ hangfireGlobalConfiguration.UsePostgreSqlStorage(options =>
+ options.UseNpgsqlConnection(connectionString), hangfireOptions.PostgreSqlStorageOptions);
break;
case "MySql":
storage = new MySqlStorage(connectionString, hangfireOptions.MySqlStorageOptions);
+ hangfireGlobalConfiguration.UseStorage(storage);
break;
default:
storage = new SqlServerStorage(connectionString, hangfireOptions.SqlServerStorageOptions);
+ hangfireGlobalConfiguration.UseStorage(storage);
break;
}
- hangfireGlobalConfiguration.UseStorage(storage);
hangfireGlobalConfiguration.UseConsole();
-
}
appBuilder.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new HangfireAuthorizationHandler() } });
diff --git a/src/VirtoCommerce.Platform.Hangfire/RecurringJobService.cs b/src/VirtoCommerce.Platform.Hangfire/RecurringJobService.cs
index 4277a49f39e..7a4de5da8ad 100644
--- a/src/VirtoCommerce.Platform.Hangfire/RecurringJobService.cs
+++ b/src/VirtoCommerce.Platform.Hangfire/RecurringJobService.cs
@@ -93,12 +93,20 @@ private async Task RunOrRemoveJobAsync(SettingCronJob settingCronJob)
{
var cronExpression = await _settingsManager.GetValueAsync(settingCronJob.CronSetting);
+ var options = new RecurringJobOptions
+ {
+ TimeZone = settingCronJob.TimeZone,
+#pragma warning disable CS0618 // Type or member is obsolete
+ // Remove when Hangfire.MySqlStorage will be updated to support JobStorageFeatures.JobQueueProperty
+ QueueName = settingCronJob.Queue,
+#pragma warning restore CS0618 // Type or member is obsolete
+ };
+
_recurringJobManager.AddOrUpdate(
settingCronJob.RecurringJobId,
settingCronJob.Job,
cronExpression,
- settingCronJob.TimeZone,
- settingCronJob.Queue);
+ options);
}
else
{
diff --git a/src/VirtoCommerce.Platform.Hangfire/SettingCronJobBuilder.cs b/src/VirtoCommerce.Platform.Hangfire/SettingCronJobBuilder.cs
index 9506b351933..9c8e528a64f 100644
--- a/src/VirtoCommerce.Platform.Hangfire/SettingCronJobBuilder.cs
+++ b/src/VirtoCommerce.Platform.Hangfire/SettingCronJobBuilder.cs
@@ -58,7 +58,8 @@ public SettingCronJobBuilder SetTimeZoneInfo(TimeZoneInfo timeZoneInfo)
public SettingCronJobBuilder ToJob(Expression> methodCall)
{
- _settingCronJob.Job = Job.FromExpression(methodCall);
+ // Uncomment when Hangfire.MySqlStorage will be updated to support JobStorageFeatures.JobQueueProperty
+ _settingCronJob.Job = Job.FromExpression(methodCall/*, _settingCronJob.Queue*/);
_settingCronJob.RecurringJobId ??= $"{_settingCronJob.Job.Type.Name}.{_settingCronJob.Job.Method.Name}";
return this;
}
diff --git a/src/VirtoCommerce.Platform.Hangfire/VirtoCommerce.Platform.Hangfire.csproj b/src/VirtoCommerce.Platform.Hangfire/VirtoCommerce.Platform.Hangfire.csproj
index 77f63813a8c..85d3b376f06 100644
--- a/src/VirtoCommerce.Platform.Hangfire/VirtoCommerce.Platform.Hangfire.csproj
+++ b/src/VirtoCommerce.Platform.Hangfire/VirtoCommerce.Platform.Hangfire.csproj
@@ -2,7 +2,7 @@
net8.0
- 1591
+ 1591;NU5048
Library
True
@@ -26,7 +26,7 @@
-
+
diff --git a/src/VirtoCommerce.Platform.Modules/External/ExternalModulesClient.cs b/src/VirtoCommerce.Platform.Modules/External/ExternalModulesClient.cs
index f5e545fd6b8..f6f023d4241 100644
--- a/src/VirtoCommerce.Platform.Modules/External/ExternalModulesClient.cs
+++ b/src/VirtoCommerce.Platform.Modules/External/ExternalModulesClient.cs
@@ -1,7 +1,8 @@
using System;
using System.IO;
-using System.Net;
+using System.Net.Http;
using Microsoft.Extensions.Options;
+using Microsoft.Net.Http.Headers;
using VirtoCommerce.Platform.Core.Modularity;
namespace VirtoCommerce.Platform.Modules.External
@@ -9,33 +10,41 @@ namespace VirtoCommerce.Platform.Modules.External
public class ExternalModulesClient : IExternalModulesClient
{
private readonly ExternalModuleCatalogOptions _options;
+ private readonly IHttpClientFactory _httpClientFactory;
- public ExternalModulesClient(IOptions options)
+ public ExternalModulesClient(IOptions options, IHttpClientFactory httpClientFactory)
{
+ _httpClientFactory = httpClientFactory;
_options = options.Value;
}
public Stream OpenRead(Uri address)
{
- using (var webClient = new WebClient())
+ var httpClient = _httpClientFactory.CreateClient();
+
+ var request = new HttpRequestMessage(HttpMethod.Get, address)
{
- webClient.Headers[HttpRequestHeader.UserAgent] = "Virto Commerce Manager";
+ Version = httpClient.DefaultRequestVersion,
+ VersionPolicy = httpClient.DefaultVersionPolicy,
+ Headers = { { HeaderNames.UserAgent, "Virto Commerce Manager" } },
+ };
- if (!string.IsNullOrEmpty(_options.AuthorizationToken))
- {
- webClient.Headers[HttpRequestHeader.Accept] = "application/octet-stream";
- webClient.Headers[HttpRequestHeader.Authorization] = "Token " + _options.AuthorizationToken;
- }
+ if (!string.IsNullOrEmpty(_options.AuthorizationToken))
+ {
+ request.Headers.Add(HeaderNames.Accept, "application/octet-stream");
+ request.Headers.Add(HeaderNames.Authorization, "Token " + _options.AuthorizationToken);
+ }
- if (!string.IsNullOrEmpty(_options.AuthorizationSchema) &&
- !string.IsNullOrEmpty(_options.AuthorizationParameter))
- {
- webClient.Headers[HttpRequestHeader.Authorization] = $"{_options.AuthorizationSchema} {_options.AuthorizationParameter}";
- }
+ if (!string.IsNullOrEmpty(_options.AuthorizationSchema) &&
+ !string.IsNullOrEmpty(_options.AuthorizationParameter))
+ {
+ request.Headers.Add(HeaderNames.Authorization, $"{_options.AuthorizationSchema} {_options.AuthorizationParameter}");
+ }
+ var response = httpClient.Send(request, HttpCompletionOption.ResponseHeadersRead);
+ response.EnsureSuccessStatusCode();
- return webClient.OpenRead(address);
- }
+ return response.Content.ReadAsStream();
}
}
}
diff --git a/src/VirtoCommerce.Platform.Modules/VirtoCommerce.Platform.Modules.csproj b/src/VirtoCommerce.Platform.Modules/VirtoCommerce.Platform.Modules.csproj
index 89f181a0861..28ac235a108 100644
--- a/src/VirtoCommerce.Platform.Modules/VirtoCommerce.Platform.Modules.csproj
+++ b/src/VirtoCommerce.Platform.Modules/VirtoCommerce.Platform.Modules.csproj
@@ -2,7 +2,7 @@
net8.0
- 1591
+ 1591;NU5048
Library
True
true
diff --git a/src/VirtoCommerce.Platform.Security.MySql/Migrations/20221124131800_Initial.Designer.cs b/src/VirtoCommerce.Platform.Security.MySql/Migrations/20221124131800_Initial.Designer.cs
deleted file mode 100644
index a11259dbed2..00000000000
--- a/src/VirtoCommerce.Platform.Security.MySql/Migrations/20221124131800_Initial.Designer.cs
+++ /dev/null
@@ -1,680 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using VirtoCommerce.Platform.Security.Repositories;
-
-#nullable disable
-
-namespace VirtoCommerce.Platform.Security.MySql.Migrations
-{
- [DbContext(typeof(SecurityDbContext))]
- [Migration("20221124131800_Initial")]
- partial class Initial
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "6.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 64);
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- b.Property("ClaimType")
- .HasColumnType("longtext");
-
- b.Property("ClaimValue")
- .HasColumnType("longtext");
-
- b.Property("RoleId")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- b.Property("ClaimType")
- .HasColumnType("longtext");
-
- b.Property("ClaimValue")
- .HasColumnType("longtext");
-
- b.Property("UserId")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("ProviderKey")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("longtext");
-
- b.Property("UserId")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("RoleId")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("LoginProvider")
- .HasColumnType("varchar(95)");
-
- b.Property("Name")
- .HasColumnType("varchar(95)");
-
- b.Property("Value")
- .HasColumnType("longtext");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("varchar(95)");
-
- b.Property("ClientId")
- .HasMaxLength(100)
- .HasColumnType("varchar(100)");
-
- b.Property("ClientSecret")
- .HasColumnType("longtext");
-
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("ConsentType")
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("DisplayName")
- .HasColumnType("longtext");
-
- b.Property("DisplayNames")
- .HasColumnType("longtext");
-
- b.Property("Permissions")
- .HasColumnType("longtext");
-
- b.Property("PostLogoutRedirectUris")
- .HasColumnType("longtext");
-
- b.Property("Properties")
- .HasColumnType("longtext");
-
- b.Property("RedirectUris")
- .HasColumnType("longtext");
-
- b.Property("Requirements")
- .HasColumnType("longtext");
-
- b.Property("Type")
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId")
- .IsUnique();
-
- b.ToTable("OpenIddictApplications", (string)null);
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("varchar(95)");
-
- b.Property("ApplicationId")
- .HasColumnType("varchar(95)");
-
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("CreationDate")
- .HasColumnType("datetime(6)");
-
- b.Property("Properties")
- .HasColumnType("longtext");
-
- b.Property("Scopes")
- .HasColumnType("longtext");
-
- b.Property("Status")
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("Subject")
- .HasMaxLength(400)
- .HasColumnType("varchar(400)");
-
- b.Property("Type")
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("ApplicationId", "Status", "Subject", "Type");
-
- b.ToTable("OpenIddictAuthorizations", (string)null);
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("varchar(95)");
-
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("Description")
- .HasColumnType("longtext");
-
- b.Property("Descriptions")
- .HasColumnType("longtext");
-
- b.Property("DisplayName")
- .HasColumnType("longtext");
-
- b.Property("DisplayNames")
- .HasColumnType("longtext");
-
- b.Property("Name")
- .HasMaxLength(200)
- .HasColumnType("varchar(200)");
-
- b.Property("Properties")
- .HasColumnType("longtext");
-
- b.Property("Resources")
- .HasColumnType("longtext");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("OpenIddictScopes", (string)null);
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("varchar(95)");
-
- b.Property("ApplicationId")
- .HasColumnType("varchar(95)");
-
- b.Property("AuthorizationId")
- .HasColumnType("varchar(95)");
-
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("CreationDate")
- .HasColumnType("datetime(6)");
-
- b.Property("ExpirationDate")
- .HasColumnType("datetime(6)");
-
- b.Property("Payload")
- .HasColumnType("longtext");
-
- b.Property("Properties")
- .HasColumnType("longtext");
-
- b.Property("RedemptionDate")
- .HasColumnType("datetime(6)");
-
- b.Property("ReferenceId")
- .HasMaxLength(100)
- .HasColumnType("varchar(100)");
-
- b.Property("Status")
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.Property("Subject")
- .HasMaxLength(400)
- .HasColumnType("varchar(400)");
-
- b.Property("Type")
- .HasMaxLength(50)
- .HasColumnType("varchar(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("AuthorizationId");
-
- b.HasIndex("ReferenceId")
- .IsUnique();
-
- b.HasIndex("ApplicationId", "Status", "Subject", "Type");
-
- b.ToTable("OpenIddictTokens", (string)null);
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Core.Security.ApplicationUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("AccessFailedCount")
- .HasColumnType("int");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("longtext");
-
- b.Property("CreatedBy")
- .HasColumnType("longtext");
-
- b.Property("CreatedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("varchar(256)");
-
- b.Property("EmailConfirmed")
- .HasColumnType("tinyint(1)");
-
- b.Property("IsAdministrator")
- .HasColumnType("tinyint(1)");
-
- b.Property("LastPasswordChangeRequestDate")
- .HasColumnType("datetime(6)");
-
- b.Property("LastPasswordChangedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("LockoutEnabled")
- .HasColumnType("tinyint(1)");
-
- b.Property("LockoutEnd")
- .HasColumnType("datetime(6)");
-
- b.Property("MemberId")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("ModifiedBy")
- .HasColumnType("longtext");
-
- b.Property("ModifiedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("varchar(256)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("varchar(256)");
-
- b.Property("PasswordExpired")
- .HasColumnType("tinyint(1)");
-
- b.Property("PasswordHash")
- .HasColumnType("longtext");
-
- b.Property("PhoneNumber")
- .HasColumnType("longtext");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("tinyint(1)");
-
- b.Property("PhotoUrl")
- .HasMaxLength(2048)
- .HasColumnType("varchar(2048)");
-
- b.Property("SecurityStamp")
- .HasColumnType("longtext");
-
- b.Property("Status")
- .HasMaxLength(64)
- .HasColumnType("varchar(64)");
-
- b.Property("StoreId")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("tinyint(1)");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("varchar(256)");
-
- b.Property("UserType")
- .HasMaxLength(64)
- .HasColumnType("varchar(64)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Core.Security.Role", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("longtext");
-
- b.Property("Description")
- .HasColumnType("longtext");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("varchar(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("varchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Security.Model.ServerCertificateEntity", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("PrivateKeyCertBase64")
- .HasColumnType("longtext");
-
- b.Property("PrivateKeyCertPassword")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("PublicCertBase64")
- .HasColumnType("longtext");
-
- b.HasKey("Id");
-
- b.ToTable("ServerCertificate", (string)null);
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Security.Model.UserApiKeyEntity", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("ApiKey")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("CreatedBy")
- .HasMaxLength(64)
- .HasColumnType("varchar(64)");
-
- b.Property("CreatedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)");
-
- b.Property("ModifiedBy")
- .HasMaxLength(64)
- .HasColumnType("varchar(64)");
-
- b.Property("ModifiedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("UserId")
- .HasColumnType("longtext");
-
- b.Property("UserName")
- .HasColumnType("longtext");
-
- b.HasKey("Id");
-
- b.HasIndex("ApiKey")
- .IsUnique();
-
- b.ToTable("UserApiKey", (string)null);
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Security.Model.UserPasswordHistoryEntity", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.Property("CreatedBy")
- .HasMaxLength(64)
- .HasColumnType("varchar(64)");
-
- b.Property("CreatedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("ModifiedBy")
- .HasMaxLength(64)
- .HasColumnType("varchar(64)");
-
- b.Property("ModifiedDate")
- .HasColumnType("datetime(6)");
-
- b.Property("PasswordHash")
- .IsRequired()
- .HasColumnType("longtext");
-
- b.Property("UserId")
- .HasMaxLength(128)
- .HasColumnType("varchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserPasswordsHistory", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("VirtoCommerce.Platform.Core.Security.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("VirtoCommerce.Platform.Core.Security.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("VirtoCommerce.Platform.Core.Security.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("VirtoCommerce.Platform.Core.Security.Role", null)
- .WithMany("UserRoles")
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("VirtoCommerce.Platform.Core.Security.ApplicationUser", null)
- .WithMany("UserRoles")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("VirtoCommerce.Platform.Core.Security.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
- {
- b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
- .WithMany("Authorizations")
- .HasForeignKey("ApplicationId");
-
- b.Navigation("Application");
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b =>
- {
- b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application")
- .WithMany("Tokens")
- .HasForeignKey("ApplicationId");
-
- b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization")
- .WithMany("Tokens")
- .HasForeignKey("AuthorizationId");
-
- b.Navigation("Application");
-
- b.Navigation("Authorization");
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Security.Model.UserPasswordHistoryEntity", b =>
- {
- b.HasOne("VirtoCommerce.Platform.Core.Security.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b =>
- {
- b.Navigation("Authorizations");
-
- b.Navigation("Tokens");
- });
-
- modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b =>
- {
- b.Navigation("Tokens");
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Core.Security.ApplicationUser", b =>
- {
- b.Navigation("UserRoles");
- });
-
- modelBuilder.Entity("VirtoCommerce.Platform.Core.Security.Role", b =>
- {
- b.Navigation("UserRoles");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/VirtoCommerce.Platform.Security.MySql/Migrations/20221124131800_Initial.cs b/src/VirtoCommerce.Platform.Security.MySql/Migrations/20221124131800_Initial.cs
deleted file mode 100644
index d5823bb5a77..00000000000
--- a/src/VirtoCommerce.Platform.Security.MySql/Migrations/20221124131800_Initial.cs
+++ /dev/null
@@ -1,563 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace VirtoCommerce.Platform.Security.MySql.Migrations
-{
- public partial class Initial : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterDatabase()
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoles", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetUsers",
- columns: table => new
- {
- Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- StoreId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- MemberId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- IsAdministrator = table.Column(type: "tinyint(1)", nullable: false),
- PhotoUrl = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserType = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Status = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreatedDate = table.Column(type: "datetime(6)", nullable: false),
- ModifiedDate = table.Column(type: "datetime(6)", nullable: true),
- CreatedBy = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ModifiedBy = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PasswordExpired = table.Column(type: "tinyint(1)", nullable: false),
- LastPasswordChangedDate = table.Column(type: "datetime(6)", nullable: true),
- LastPasswordChangeRequestDate = table.Column(type: "datetime(6)", nullable: true),
- UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false),
- PasswordHash = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- SecurityStamp = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PhoneNumber = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false),
- TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false),
- LockoutEnd = table.Column(type: "datetime(6)", nullable: true),
- LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false),
- AccessFailedCount = table.Column(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUsers", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "OpenIddictApplications",
- columns: table => new
- {
- Id = table.Column(type: "varchar(95)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientSecret = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyToken = table.Column(type: "varchar(50)", maxLength: 50, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConsentType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayName = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayNames = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Permissions = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PostLogoutRedirectUris = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Properties = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- RedirectUris = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Requirements = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_OpenIddictApplications", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "OpenIddictScopes",
- columns: table => new
- {
- Id = table.Column(type: "varchar(95)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyToken = table.Column(type: "varchar(50)", maxLength: 50, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Descriptions = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayName = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayNames = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Properties = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Resources = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_OpenIddictScopes", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "ServerCertificate",
- columns: table => new
- {
- Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PublicCertBase64 = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PrivateKeyCertBase64 = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PrivateKeyCertPassword = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ServerCertificate", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "UserApiKey",
- columns: table => new
- {
- Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserName = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ApiKey = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserId = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- IsActive = table.Column(type: "tinyint(1)", nullable: false),
- CreatedDate = table.Column(type: "datetime(6)", nullable: false),
- ModifiedDate = table.Column(type: "datetime(6)", nullable: true),
- CreatedBy = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ModifiedBy = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserApiKey", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetRoleClaims",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
- RoleId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClaimType = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClaimValue = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetUserClaims",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
- UserId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClaimType = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClaimValue = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetUserClaims_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetUserLogins",
- columns: table => new
- {
- LoginProvider = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ProviderKey = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ProviderDisplayName = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
- table.ForeignKey(
- name: "FK_AspNetUserLogins_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetUserPasswordsHistory",
- columns: table => new
- {
- Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PasswordHash = table.Column(type: "longtext", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreatedDate = table.Column(type: "datetime(6)", nullable: false),
- ModifiedDate = table.Column(type: "datetime(6)", nullable: true),
- CreatedBy = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ModifiedBy = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserPasswordsHistory", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetUserPasswordsHistory_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetUserRoles",
- columns: table => new
- {
- UserId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- RoleId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
- table.ForeignKey(
- name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_AspNetUserRoles_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "AspNetUserTokens",
- columns: table => new
- {
- UserId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- LoginProvider = table.Column(type: "varchar(95)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Name = table.Column(type: "varchar(95)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
- table.ForeignKey(
- name: "FK_AspNetUserTokens_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
-
- migrationBuilder.CreateTable(
- name: "OpenIddictAuthorizations",
- columns: table => new
- {
- Id = table.Column(type: "varchar(95)", nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ApplicationId = table.Column(type: "varchar(95)", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyToken = table.Column