Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to ASP.NET Core 5 #286

Closed
muratcakir opened this issue Aug 18, 2020 · 12 comments
Closed

Port to ASP.NET Core 5 #286

muratcakir opened this issue Aug 18, 2020 · 12 comments
Assignees
Labels
core .NET core

Comments

@muratcakir
Copy link
Contributor

muratcakir commented Aug 18, 2020

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.
@pineportal
Copy link

@mgesing
Copy link
Contributor

mgesing commented Aug 19, 2020

Web API:

@muratcakir
Copy link
Contributor Author

muratcakir commented Oct 2, 2020

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
Copy link
Contributor Author

muratcakir commented Oct 2, 2020

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().Attach()
IDbContext.QueryForCollection() EntityEntry.Collection(...).Query()
IDbContext.QueryForReference() EntityEntry.Reference(...).Query()
IQueryable.Expand() IQueryable.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(...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
Copy link
Contributor Author

Architecture

  • Use efcore global query filters where applicable

@pineportal
Copy link

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

@muratcakir
Copy link
Contributor Author

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.

@mehmetcantas
Copy link

Any updates?

@muratcakir
Copy link
Contributor Author

Any updates?

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

@muratcakir muratcakir changed the title Port to ASP.NET Core Port to ASP.NET Core 5 Nov 17, 2020
@muratcakir muratcakir transferred this issue from smartstore/SmartStoreNET Nov 18, 2020
@muratcakir muratcakir transferred this issue from another repository Nov 18, 2020
@muratcakir muratcakir transferred this issue from smartstore/Smartstore Nov 18, 2020
@zihniartar zihniartar transferred this issue from smartstore/SmartStoreNET Jan 7, 2021
@muratcakir muratcakir added the core .NET core label Feb 1, 2021
@muratcakir muratcakir pinned this issue Feb 9, 2021
@lucakuehne
Copy link

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

@muratcakir
Copy link
Contributor Author

The Beta will be released within the next few weeks.

@stefanmuellerdo
Copy link

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

@muratcakir muratcakir unpinned this issue Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core .NET core
Projects
None yet
Development

No branches or pull requests

8 participants