Smartstore
Smartstore copied to clipboard
Port to ASP.NET Core 5
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.~~
suggestion: https://github.com/VahidN/EFSecondLevelCache.Core
Web API:
- Migration and sample.
- Replace outdated Swashbuckle component by Swashbuckle.AspNetCore.
- Complex Type with navigation property requires OData ASP.NET Web API > V6.
Performance best-practices
-
async/await
all the way! - Use
HttpClientFactory
to obtainHttpClient
instances - Use
EF.CompileQuery
where applicable - Use HTTP response compression
- Always access HttpRequest/HttpResponse body async
- Prefer
ReadFormAsync
overRequest.Form
- Never store IHttpContextAccessor.HttpContext in a field
- Wrap long running processes with many database calls into
DbContext.OpenConnection[Async]()
orDbContextScope(retainConnection: true)
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. |
Architecture
- Use efcore global query filters where applicable
task scheduler: https://github.com/quartznet/quartznet
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.
Any updates?
Any updates?
The new Smartstore Core repository is private at this moment, we will make it public next week hopefully.
Is there an ETA for the migration to ASP.NET Core?
The Beta will be released within the next few weeks.
release ist done ... can this be closed now?