Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Hosting;
using Microsoft.AspNetCore.Hosting;
using Autofac;
using SmartStore.Core.Infrastructure;

Expand Down Expand Up @@ -344,6 +344,9 @@ public override SynchronizationContext CreateCopy()
}
}

// Commented out for .NET 8 migration - IRegisteredObject not available
// Replace with IHostedService in ASP.NET Core
/*
internal class BackgroundWorkHost : IRegisteredObject
{
private readonly CancellationTokenSource _shutdownCancellationTokenSource = new CancellationTokenSource();
Expand Down Expand Up @@ -421,4 +424,5 @@ private void FinalShutdown()
}

}
*/
}
4 changes: 2 additions & 2 deletions src/Libraries/SmartStore.Core/BaseEntity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Core.Objects;
// using Microsoft.EntityFrameworkCore.Core.Objects; // Removed for .NET 8 migration
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -32,7 +32,7 @@ public Type GetUnproxiedType()
{
#region Old
//var t = GetType();
//if (t.AssemblyQualifiedName.StartsWith("System.Data.Entity."))
//if (t.AssemblyQualifiedName.StartsWith("Microsoft.EntityFrameworkCore."))
//{
// // it's a proxied type
// t = t.BaseType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using SmartStore.Core.Infrastructure.DependencyManagement;
// using SmartStore.Core.Infrastructure.DependencyManagement; // Removed for .NET 8 migration
using SmartStore.Utilities;
using SmartStore.Utilities.Threading;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq.Expressions;
using SmartStore.Core.Configuration;
using SmartStore.Core.Data.Hooks;
using SmartStore.Core.Infrastructure.DependencyManagement;
// using SmartStore.Core.Infrastructure.DependencyManagement; // Removed for .NET 8 migration
using SmartStore.Utilities;

namespace SmartStore.Core.Caching
Expand Down
7 changes: 4 additions & 3 deletions src/Libraries/SmartStore.Core/Caching/RequestCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
// using System.Web; // Removed for .NET 8 migration
using Microsoft.AspNetCore.Http;
using SmartStore.Utilities;

namespace SmartStore.Core.Caching
Expand All @@ -14,9 +15,9 @@ public class RequestCache : DisposableObject, IRequestCache

private readonly IDictionary _emptyDictionary = new Dictionary<string, object>();

private readonly HttpContextBase _context;
private readonly HttpContext _context;

public RequestCache(HttpContextBase context)
public RequestCache(HttpContext context)
{
_context = context;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/SmartStore.Core/Collections/Querystring.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ο»Ώusing System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Web;
// using System.Web; // Removed for .NET 8 migration
using SmartStore.Utilities.ObjectPools;

namespace SmartStore.Collections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.Web.Routing;
using Microsoft.AspNetCore.Routing;
using SmartStore.Utilities;

namespace SmartStore.ComponentModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Dynamic;
using System.Web.Routing;
using Microsoft.AspNetCore.Routing;
using Newtonsoft.Json.Linq;
using SmartStore.Core.Domain.Catalog;
using SmartStore.Core.Domain.Shipping;
Expand Down
14 changes: 8 additions & 6 deletions src/Libraries/SmartStore.Core/Data/Hooks/HookedEntity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ο»Ώusing System;
using System.Data.Entity.Infrastructure;
using EfState = System.Data.Entity.EntityState;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Infrastructure;
using EfState = Microsoft.EntityFrameworkCore.EntityState;

namespace SmartStore.Core.Data.Hooks
{
Expand All @@ -14,7 +16,7 @@ public interface IHookedEntity
/// <summary>
/// Gets the hooked entity entry
/// </summary>
DbEntityEntry Entry { get; }
EntityEntry Entry { get; }

/// <summary>
/// Gets the hooked entity instance
Expand Down Expand Up @@ -61,12 +63,12 @@ public class HookedEntity : IHookedEntity
{
private Type _entityType;

public HookedEntity(IDbContext context, DbEntityEntry entry)
public HookedEntity(IDbContext context, EntityEntry entry)
: this(context.GetType(), entry)
{
}

internal HookedEntity(Type contextType, DbEntityEntry entry)
internal HookedEntity(Type contextType, EntityEntry entry)
{
ContextType = contextType;
Entry = entry;
Expand All @@ -78,7 +80,7 @@ public Type ContextType
get;
}

public DbEntityEntry Entry
public EntityEntry Entry
{
get;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Libraries/SmartStore.Core/Data/IDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.Entity;
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;

namespace SmartStore.Core.Data
Expand Down Expand Up @@ -151,7 +151,7 @@ IList<TEntity> ExecuteStoredProcedureList<TEntity>(string commandText, params ob
/// <typeparam name="TEntity">Type of entity</typeparam>
/// <param name="entity">The entity instance</param>
/// <param name="requestedState">The requested new state</param>
void ChangeState<TEntity>(TEntity entity, System.Data.Entity.EntityState requestedState) where TEntity : BaseEntity;
void ChangeState<TEntity>(TEntity entity, Microsoft.EntityFrameworkCore.EntityState requestedState) where TEntity : BaseEntity;

/// <summary>
/// Reloads the entity from the database overwriting any property values with values from the database.
Expand Down
8 changes: 4 additions & 4 deletions src/Libraries/SmartStore.Core/Data/IDbContextExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ο»Ώusing System;
using System.Collections.Generic;
using System.Data.Entity;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Linq.Expressions;
using SmartStore.Core;
Expand Down Expand Up @@ -41,7 +41,7 @@ public static bool SetToUnchanged<TEntity>(this IDbContext ctx, TEntity entity)
{
try
{
ctx.ChangeState<TEntity>(entity, System.Data.Entity.EntityState.Unchanged);
ctx.ChangeState<TEntity>(entity, Microsoft.EntityFrameworkCore.EntityState.Unchanged);
return true;
}
catch (Exception ex)
Expand Down Expand Up @@ -111,7 +111,7 @@ public static void LoadCollection<TEntity, TCollection>(
var collection = entry.Collection(navigationProperty);

// Avoid System.InvalidOperationException: Member 'IsLoaded' cannot be called for property...
if (entry.State == System.Data.Entity.EntityState.Detached)
if (entry.State == Microsoft.EntityFrameworkCore.EntityState.Detached)
{
ctx.Attach(entity);
}
Expand Down Expand Up @@ -166,7 +166,7 @@ public static void LoadReference<TEntity, TProperty>(
var reference = entry.Reference(navigationProperty);

// Avoid System.InvalidOperationException: Member 'IsLoaded' cannot be called for property...
if (entry.State == System.Data.Entity.EntityState.Detached)
if (entry.State == Microsoft.EntityFrameworkCore.EntityState.Detached)
{
ctx.Attach(entity);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/SmartStore.Core/Data/IQueryableExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ο»Ώusing System;
using System.Data.Entity;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Linq.Expressions;
using SmartStore.Core;
Expand Down
4 changes: 2 additions & 2 deletions src/Libraries/SmartStore.Core/Data/RepositoryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ο»Ώusing System;
using System.Collections.Generic;
using System.Data.Entity;
using Microsoft.EntityFrameworkCore;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
Expand Down Expand Up @@ -45,7 +45,7 @@ public static void Delete<T>(this IRepository<T> rs, int id) where T : BaseEntit
entity.Id = id;

// must downcast 'cause of Rhino mocks stub
rs.Context.ChangeState((BaseEntity)entity, System.Data.Entity.EntityState.Deleted);
rs.Context.ChangeState((BaseEntity)entity, Microsoft.EntityFrameworkCore.EntityState.Deleted);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
1 change: 0 additions & 1 deletion src/Libraries/SmartStore.Core/Domain/Blogs/BlogPost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ public static IReadOnlyCollection<string> GetVisibilityAffectingPropertyNames()
/// Gets or sets a language identifier for which the blog post should be displayed.
/// </summary>
[DataMember]
[Index]
public int? LanguageId { get; set; }

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Libraries/SmartStore.Core/Domain/Catalog/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ public partial class Category : BaseEntity, ICategoryNode, IAuditable, ISoftDele
/// <summary>
/// Gets or sets a value indicating whether the entity has been deleted
/// </summary>
[Index]
public bool Deleted { get; set; }

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Libraries/SmartStore.Core/Domain/Catalog/Manufacturer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public partial class Manufacturer : BaseEntity, IAuditable, ISoftDeletable, ILoc
/// Gets or sets a value indicating whether the entity is subject to ACL.
/// </summary>
[DataMember]
[Index]
public bool SubjectToAcl { get; set; }

/// <summary>
Expand All @@ -121,7 +120,6 @@ public partial class Manufacturer : BaseEntity, IAuditable, ISoftDeletable, ILoc
/// <summary>
/// Gets or sets a value indicating whether the entity has been deleted
/// </summary>
[Index]
public bool Deleted { get; set; }

/// <summary>
Expand Down
10 changes: 0 additions & 10 deletions src/Libraries/SmartStore.Core/Domain/Catalog/Product.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public static IReadOnlyCollection<string> GetVisibilityAffectingPropertyNames()
/// Gets or sets the visibility level of the product.
/// </summary>
[DataMember]
[Index]
public ProductVisibility Visibility { get; set; }

/// <summary>
Expand Down Expand Up @@ -216,7 +215,6 @@ public string Sku
/// Gets or sets the manufacturer part number
/// </summary>
[DataMember]
[Index]
public string ManufacturerPartNumber
{
[DebuggerStepThrough]
Expand All @@ -228,7 +226,6 @@ public string ManufacturerPartNumber
/// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books).
/// </summary>
[DataMember]
[Index]
public string Gtin
{
[DebuggerStepThrough]
Expand Down Expand Up @@ -669,30 +666,23 @@ public decimal Height
/// Gets or sets a value indicating whether the entity is published
/// </summary>
[DataMember]
[Index("IX_Product_Published_Deleted_IsSystemProduct", 1)]
public bool Published { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the entity has been deleted
/// </summary>
[Index]
[Index("IX_Product_Published_Deleted_IsSystemProduct", 2)]
public bool Deleted { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the entity is a system product.
/// </summary>
[DataMember]
[Index]
[Index("IX_Product_SystemName_IsSystemProduct", 2)]
[Index("IX_Product_Published_Deleted_IsSystemProduct", 3)]
public bool IsSystemProduct { get; set; }

/// <summary>
/// Gets or sets the product system name.
/// </summary>
[DataMember]
[Index("IX_Product_SystemName_IsSystemProduct", 1)]
public string SystemName { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ public partial class ProductAttribute : BaseEntity, ILocalizedEntity, ISearchAli
/// Gets or sets whether the attribute can be filtered
/// </summary>
[DataMember]
[Index]
public bool AllowFiltering { get; set; }

/// <summary>
/// Gets or sets the display order
/// </summary>
[DataMember]
[Index]
public int DisplayOrder { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public partial class ProductCategory : BaseEntity
/// Gets or sets a value indicating whether the product is featured
/// </summary>
[DataMember]
[Index]
public bool IsFeaturedProduct { get; set; }

/// <summary>
Expand All @@ -38,7 +37,6 @@ public partial class ProductCategory : BaseEntity
/// Indicates whether the mapping is created by the user or by the system.
/// </summary>
[DataMember]
[Index]
public bool IsSystemMapping { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public partial class ProductManufacturer : BaseEntity
/// Gets or sets a value indicating whether the product is featured
/// </summary>
[DataMember]
[Index]
public bool IsFeaturedProduct { get; set; }

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Libraries/SmartStore.Core/Domain/Catalog/ProductTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public partial class ProductTag : BaseEntity, ILocalizedEntity
/// Gets or sets a value indicating whether the entity is published.
/// </summary>
[DataMember]
[Index("IX_ProductTag_Published")]
public bool Published { get; set; } = true;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public partial class ProductVariantAttribute : BaseEntity, ILocalizedEntity
/// Gets or sets the product identifier
/// </summary>
[DataMember]
[Index("IX_Product_ProductAttribute_Mapping_ProductId_DisplayOrder", 1)]
public int ProductId { get; set; }

/// <summary>
Expand Down Expand Up @@ -51,14 +50,12 @@ public partial class ProductVariantAttribute : BaseEntity, ILocalizedEntity
/// Gets or sets the attribute control type identifier
/// </summary>
[DataMember]
[Index]
public int AttributeControlTypeId { get; set; }

/// <summary>
/// Gets or sets the display order
/// </summary>
[DataMember]
[Index("IX_Product_ProductAttribute_Mapping_ProductId_DisplayOrder", 2)]
public int DisplayOrder { get; set; }

/// <summary>
Expand Down
Loading