Smartstore icon indicating copy to clipboard operation
Smartstore copied to clipboard

Port to ASP.NET Core 5

Open muratcakir opened this issue 4 years ago • 11 comments

Parts/modules that require a complete rewrite:

  • ~~Plugin Bootstrapper~~
  • ~~Theming engine (most parts)~~
  • ~~Custom Razor stuff~~
  • ~~Bundling & Minification & SASS compiler (BundleTransformer > Custom bundler)~~
  • ~~Autofac: InstancePerRequest > InstancePerLifetimeScope~~
  • ~~Telerik UI components~~
    • ~~Grid~~
    • ~~Numeric inputs~~
  • ~~No domain proxies anymore (thanks god). ILazyLoader instead.~~
  • ~~Remove all [Serializable] attributes.~~
  • ~~Remove all [DataContract] and [DataMember] attributes on domain entities. Use [JsonIgnore] for exclusions.~~
  • ~~Datepicker UI component~~
  • ~~Smartstore UI components (> TagHelpers)~~
  • ~~DB Hooking Framework (partially)~~
  • ~~SEO / multilang MVC routing~~
  • ~~Media file middleware~~
  • ~~Authentication > ASP.NET Identity (?)~~
  • ~~PDF engine (> Custom wkhtmltopdf wrapper)~~
  • ~~Newtonsoft.Json > System.Text.Json (?)~~
  • ~~E-Mail sender~~
  • ~~ImageProcessor > ImageSharp~~
  • ~~log4net > NLog | SeriLog~~
  • UrlRewriter > UseRewriter() with AddApacheModRewrite()
  • ~~Memory cache~~
  • ~~WebHelper~~
  • ~~QueryString > wrap IQueryCollection~~
  • ~~EF 2nd level cache (https://github.com/VahidN/EFCoreSecondLevelCacheInterceptor)~~
  • ~~EF 2nd level request cache: policy based.~~
  • ~~Implement EF BatchDelete and BatchUpdate~~
  • ~~IO/Disk stuff~~
  • ~~IFileSystem > IFileProvider (?)~~
  • ~~All VirtualPathProviders~~
  • ~~Replace Inflector, Prettifiers etc. with Humanizer library~~
  • Refactor/Move all extension methods that contain DI calls
  • Make everything Async
  • ~~MimeTypes > FileExtensionContentTypeProvider (for static files)~~
  • Child action > ViewComponent (model binding in child actions > invoke component with PageBase.TryUpdateModel[...])
  • ~~Blog/News/Forum/~~Polls > make modules
  • ~~SettingService: Cache scopes must be created from caller (no clearCache params anymore)~~
  • ~~Host shutdown > IHostApplicationLifetime.ApplicationStopping~~
  • Change all [DllImport] annotations
  • ~~No NameValueCollection anymore. Refactor BuildQueryString() callers accordingly.~~
  • ~~Language resource names with type names in it (e.g. Enums) must be changed.~~

muratcakir avatar Aug 18 '20 18:08 muratcakir

suggestion: https://github.com/VahidN/EFSecondLevelCache.Core

pineportal avatar Aug 19 '20 08:08 pineportal

Web API:

mgesing avatar Aug 19 '20 20:08 mgesing

Performance best-practices

  • async/await all the way!
  • Use HttpClientFactory to obtain HttpClient instances
  • Use EF.CompileQuery where applicable
  • Use HTTP response compression
  • Always access HttpRequest/HttpResponse body async
  • Prefer ReadFormAsync over Request.Form
  • Never store IHttpContextAccessor.HttpContext in a field
  • Wrap long running processes with many database calls into DbContext.OpenConnection[Async]() or DbContextScope(retainConnection: true)

muratcakir avatar Oct 02 '20 16:10 muratcakir

Terminology changes

Old New
Plugin Module

Type/member name changes

Old New
HostingEnvironment.IsHosted CommonHelper.IsHosted
CommonHelper.GetAppSetting Removed. Use strongly typed IApplicationContext.AppConfiguration instead
CommonHelper.HasConnectionString Removed
FileSystemHelper Removed. Use IFileSystem extensions instead.
DataSettings.Current DataSettings.Instance
LocalizedString.(Js)Text LocalizedString.(Js)Value
HttpRequestBase.IsHttps() HttpRequest.IsSecureConnection()
IDbContext.DetachAll() DbContext.ChangeTracker.Clear()
IDbContext.Attach() DbContext.Set<T>().Attach()
IDbContext.QueryForCollection() EntityEntry.Collection(...).Query()
IDbContext.QueryForReference() EntityEntry.Reference(...).Query()
IQueryable<T>.Expand() IQueryable<T>.Include()
IStoreMappingSupported IStoreRestricted
IStoreService Removed. Use IStoreContext instead
Querystring MutableQueryCollection
KeyedLock AsyncLock
LocalizationHelper CultureHelper
ISettingService.LoadSetting() ISettingFactory.LoadSettings() (Singleton)
ISettingService.SaveSetting() ISettingFactory.SaveSettings() (Singleton)
ISettingService.SetSetting() ISettingService.ApplySettingAsync()
ISettingService.DeleteSetting() ISettingService.RemoveSettingAsync()
ILocalizedEntityService.Save*() ILocalizedEntityService.Apply*()
ILocalizationService.Import*() IXmlResourceManager.*()
ILocalizationService.Export*() IXmlResourceManager.*()
ICustomerActivityService.InsertActivity() IActivityLogger.LogActivity()
decimal.RoundToNearest() Currency.RoundToNearest()
decimal.RoundIfEnabledFor() Currency.RoundIfEnabledFor()
string.IsCaseInsensitiveEqual() string.EqualsNoCase()
string.IsCaseSensitiveEqual() Removed
BasePlugin.AddOrUpdatePluginLocaleResource() Removed
BasePlugin.DeletePluginLocaleResource() ILocalizationService.DeleteLocaleStringResourcesAsync()
PluginDescriptor.GetLocalizedValue() LocalizedEntityHelper.GetLocalizedModuleProperty()
IUrlRecordService IUrlService
SeoExtensions.ValidateSeName() IUrlService.ValidateSlugAsync(). extraSlugLookup param removed. Now tracked internally.
SeoExtensions.GetSeName(string, [SeoSettings]) SeoHelper.GetSeName(*)
SeoExtensions.GetSeName(this...) SeoExtensions.GetActiveSlug() or SeoExtensions.BuildSlug()
LocalizedEntityHelper.GetSeName() LocalizedEntityHelper.GetActiveSlug()
IUrlRecordService.SaveSlug<T>(...Func<T, string> nameProperty) Removed. Use ApplySlugAsync()
IGenericAttributeService.GetAttributesForEntity(int[], string) Removed. Use IGenericAttributeService.PrefetchAttributesAsync(), then MyEntity.GenericAttributes.
IGenericAttributeService.GetAttribute(), ...SaveAttribute() Removed. Use MyEntity.GenericAttributes.Get() or ...Set(), or use property getter/setter of covariant attribute collection types.

muratcakir avatar Oct 02 '20 17:10 muratcakir

Architecture

  • Use efcore global query filters where applicable

muratcakir avatar Oct 02 '20 18:10 muratcakir

task scheduler: https://github.com/quartznet/quartznet

pineportal avatar Nov 10 '20 16:11 pineportal

task scheduler: https://github.com/quartznet/quartznet

Absolutely no! We gonna keep our self-made web scheduler that solves all dependency scoping and mem leak issues we had before.

muratcakir avatar Nov 10 '20 20:11 muratcakir

Any updates?

mehmetcantas avatar Nov 15 '20 18:11 mehmetcantas

Any updates?

The new Smartstore Core repository is private at this moment, we will make it public next week hopefully.

muratcakir avatar Nov 16 '20 18:11 muratcakir

Is there an ETA for the migration to ASP.NET Core?

lucakuehne avatar Feb 22 '22 09:02 lucakuehne

The Beta will be released within the next few weeks.

muratcakir avatar Feb 23 '22 19:02 muratcakir

release ist done ... can this be closed now?

stefanmuellerdo avatar Aug 19 '22 10:08 stefanmuellerdo