prepare labb auto register in autofac configmapper smaller functionality web events demo labb ...
TRANSCRIPT
![Page 1: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/1.jpg)
Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore
WEBFOUNDATION 2.0 KURSINNEHÅLL
![Page 2: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/2.jpg)
WEBFOUNDATION 2.0 KURSPREPARE LABB
Download WF from:http://win.wipcore.se/Downloads/Item/WebFoundation-2.0.0.117
install VS 2012 (Or Install download .net 4.5, install : MVC 4 )
![Page 3: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/3.jpg)
Speed up your development with Auto register in Autofac. No need to know and write Autofac register code anymore, just follow naming convention of classes. If you find something to customize in Webfoundation just inherit interface or class and override functionality.
[AutoRegisterAsSingleInstance], "Service", "Repository", "Provider", "Listener", "Factory“
[AutoRegisterAsInstancePerDependency], "Model", "Mapper", "Filter", "ViewData”
WebFoundation.AutoRegister.ExceptTypes
WEBFOUNDATION 2.0 KURSAUTO REGISTER IN AUTOFAC
![Page 4: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/4.jpg)
WEBFOUNDATION 2.0 KURSAUTO REGISTER IN AUTOFAC
![Page 5: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/5.jpg)
DependencyResolver.Current.GetService<>() Func <> to create x number of classes from another class
(you could also use in-argument). IEnumerable <> to get all the classes that are registered
with an interface. http://win.wipcore.se/Library/Index/WebFoundation.Auto.reg
ister.in.Autofac
WEBFOUNDATION 2.0 KURSAUTO REGISTER IN AUTOFAC
![Page 6: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/6.jpg)
A new alternative to the Factory layer in Webfoundation called ConfigMapper.The purpose of this layer is to get data from Enova, transform (cache) it so it can be displayed . By configuration in xml file (or backoffice) you specify what to map from Enova to the site. The goal is to improve developer speed, Site speed and flexibility.
WEBFOUNDATION 2.0 KURSCONFIGMAPPER
![Page 7: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/7.jpg)
WEBFOUNDATION 2.0 KURSCONFIGMAPPER
![Page 8: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/8.jpg)
Just write “?” in configuration to get existing properties (sometimes you need to clear the cache with url /debugcache/clear ):
WEBFOUNDATION 2.0 KURSCONFIGMAPPER
![Page 9: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/9.jpg)
WEBFOUNDATION 2.0 KURSCONFIGMAPPER
![Page 10: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/10.jpg)
WEBFOUNDATION 2.0 KURSCONFIGMAPPER
![Page 11: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/11.jpg)
http://win.wipcore.se/Library/Index/WebFoundation.ConfigMapper
WEBFOUNDATION 2.0 KURSCONFIGMAPPER
![Page 12: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/12.jpg)
A new Enova dependency cache wich will cache as long the object is not changed in Enova. Only supported when Enova is started in process. This might result in that changes in backoffice will not affect a web started in remote mode.
var policy = new CacheItemPolicy();policy.ChangeMonitors AddEnovaChangeMonitor(product.ID);MemoryCache.Default.Add("testkey", "testValue", policy);
Built on:
WEBFOUNDATION 2.0 KURSSMALLER FUNCTIONALITY
![Page 13: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/13.jpg)
Providers:EnovaContextProviderHttpContextProviderHttpRequestProviderHttpSessionProvider
Extensions (using Wipcore.WebFoundation.Base.Extensions):T GetItem<T>(this HttpContextBase httpContextBase,string key, Func<T> createItem)
T GetItem<T>(this HttpSessionStateBase httpSessionStateBase, string key, Func<T> createItem)
T Get<T>(this ObjectCache objectCache, string key, Func<T> createValue, DateTimeOffset absoluteExpiration, string regionName = null)
T Get<T>(this NameValueCollection appSettings, string key, T defaultValue = default(T))
I.e.
WEBFOUNDATION 2.0 KURSSMALLER FUNCTIONALITY
![Page 14: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/14.jpg)
Updated Enova Generics: http://win.wipcore.se/Library/Index/Wipcore.eNOVA.Generics
WEBFOUNDATION 2.0 KURSSMALLER FUNCTIONALITY
![Page 15: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/15.jpg)
WEBFOUNDATION 2.0 KURSSMALLER FUNCTIONALITY
![Page 16: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/16.jpg)
ATimerListener makes it possible to schedule events on the web. This might be good if you want to make less complex things without creating integration. If it is not finished on time, it skips to the next opportunity.
AControllerTimerListener makes it possible to schedule an MVC controller on the web, i.e. for caching a page.
IApplicationListener application_start and end error. IRequestListener RequestBegin, RequestEnd , PreRequestExecute,
PostRequestExecutePlease also consider MVC GlobalFilters!
ISessionListener Begin,End You could also set the order to: First, Normal, Last which intentionally is
a rough range.
WEBFOUNDATION 2.0 KURSWEB EVENTS
![Page 17: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/17.jpg)
http://win.wipcore.se/Library/Index/Web.events.for.Web.Foundation
WEBFOUNDATION 2.0 KURSWEB EVENTS
![Page 18: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/18.jpg)
http://webfoundation.wipcore.se/ Check My.Web for best practice!!! i.e. Nuget for references (js in script folder) Enova CMS Template MyPage.cs, just follow instructions to create a new Page
type. Build event for update portable bs. http://
win.wipcore.se/Library/Index/Wipcore.eNOVA.Remoting.with.IPC
WEBFOUNDATION 2.0 KURSDEMO
![Page 19: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/19.jpg)
MVC RenderAction:
WEBFOUNDATION 2.0 KURSDEMO
![Page 20: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/20.jpg)
http://www.webfoundation.se/debugcache/index http://www.webfoundation.se/debugcache/clear
WEBFOUNDATION 2.0 KURSDEMO
![Page 21: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/21.jpg)
WEBFOUNDATION 2.0 KURSDEMO
![Page 22: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/22.jpg)
MVC Miniprofiler
WEBFOUNDATION 2.0 KURSDEMO
![Page 23: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/23.jpg)
Less,MVC bundle
WEBFOUNDATION 2.0 KURSDEMO
![Page 24: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/24.jpg)
Xml transformation, SlowSheeta
WEBFOUNDATION 2.0 KURSDEMO
![Page 25: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/25.jpg)
One click deploy!
WEBFOUNDATION 2.0 KURSDEMO
![Page 26: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/26.jpg)
Best practice Autofac and override of WF controllers:
WEBFOUNDATION 2.0 KURSDEMO
![Page 27: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/27.jpg)
Elmah view and mail errors:
WEBFOUNDATION 2.0 KURSDEMO
![Page 28: Prepare labb Auto register in Autofac ConfigMapper Smaller Functionality Web events Demo Labb WebFoundation, Wipcore WEBFOUNDATION 2.0](https://reader036.vdocuments.net/reader036/viewer/2022062511/551aa9bd550346e0158b5e65/html5/thumbnails/28.jpg)
Tips Debug Webfoundation: http://enovaleaks.se/2012/12/17/hur-man-debuggar-webfoundation/
2 branches \tfs\WipcoreWebFoundationDev\tfs\WipcoreWebFoundationRelease\V2.0.0
Don’t miss to read “WebFoundation Release notes.docx” and “WebFoundation installation manual.docx” in the zip which explains how to upgrade your WF project.
Send suggestions and fixes!!!! Read your homework: http://enovaleaks.se/
WEBFOUNDATION 2.0 KURSWEBFOUNDATION, WIPCORE