CONTENTSTART
EXCLUDESTART EXCLUDEEND

Where in the World is DevTrev?

Life Updates

First off, hopefully everyone is weathering this whole Covid-19 lockdown well and is healthy and making it.  While I am blessed that this has not greatly affected me and my family, I know it has affected many. The past couple months have honestly been very busy despite the lock down, which is why there has been little activity on DevTrev.com  Over the past 2 months I’ve been very busy and the little free time that I usually use to work on these blog articles has been consumed with farm-life (as you may know, I have a little homestead).  To list a few accomplishments this spring:

  1. Repaired the engine on our Garden tractor and tilled the garden (chewed wires from mice, a bent rod, and a bad gasket)
  2. Rebuilt the 75’ fence and gate along the one side that got torn apart
  3. Built, installed 16 10’x3’x1’ raised beds (30,000 lb. of shoveled dirt later….)
  4. Repaired the engine on the mower (also chewed wires from mice….)
  5. Planted our garden (probably over 1000 plants/seeds)
  6. Installed the new bees in the hive
  7. Started to till the other field in preparations for an orchard next year
  8. Started cleaning up the property
As you can see, I have been quite busy.  That along with spending time with Elijah and my wife (Elijah is now 2 and a half and he is a joyful handful!)

Repository Updates

Along with life getting in the way, my various existing repositories have taken up a good amount of my 'free' time in maintenance.  Heartland Business Systems (whom I work for) has been very gracious in letting all the non-bill time slide as I work on these tools to help everyone. Here is a list of updates that have occurred in the past couple months:

Dynamic Routing

I have made a couple fixes and improvements to the Dynamic Routing module that we encountered while using.

  1. Automatic Output Cache Dependency: Whenever you call the GetPage() method of the Dynamic Routing, the page is automatically added to the OutputCacheDependencies (unless you specify for it not to be), since it’s logical that if you call the GetPage() on the rendering, you are using the page in some capacity and the output should be invalidated if your page changes.
  2. Automatic Output Cache: If you use the "Quick" Dynamic Routes (no Controller, just a View or View+Model), you now have the option to enable OutputCache on those views through the DynamicRouting attribute.
  3. Fix to Url.Action: I discovered a bug where Dynamic Routing would mess up the Url.Action() generation.  This was due to how Url.Action works, it goes through the routing and takes the URL generated by the first valid route, and the DynamicRoute would always be valid on any page it was called on because it was checking the current request URL, not the URL that was attempting to be generated.  This has been fixed.
  4. Interfaced: The Static DynamicRouteHelper class has been converted to an interface so you can better UnitTest with it.  If you upgrade, you will see an obsolete note, please be sure to read the note carefully as you must modify the dependency injection to leverage this interface.

New Tool: LocalizedAttributes

I created a new tool, a Localized variation of the default MVC Data Annotation Attributes.  This came when I was working on some custom forms in MVC and discovered that there was not an easy way to pass localized strings (such as {$ MyCustom.String $} to the error messages).  We have a handful of clients who have multi-lingual sites, and Kentico's forms and error messages in Portal Engine were always localizable, so I created this module which recreates all the standard DataAnnotation validation attributes that come with MVC, along with a class to inherit when you build your own.
More information on this project’s Git.

MVC Caching Documentation Update

I have updated the MVC Caching Documentation readme file to include some more accurate information.  I discovered that the [CacheDependency] attribute and the automatic Caching did not work when you called the method from within the implantation (if my repository called another method within itself).  This was because the automatic caching was enacted by the Dependency Injection (Autofac) system, so if you called the method outside of that, there was no way for it to intercept the method and cache it.  So, I have added some examples and suggestions to handle this (either call the method through the Dependency Injection or add a Helper interface).  I also updated the information on how to leverage [OutputCache]

Status of Part 2 of the MVC Site Build

Now finally, some information on where things are at for the Part 2 of my Build a Kentico site in 24 hours.  To be honest, part of how a site can be 'built' in 24 hours depends on having a great starting point, and that is what I have been working on creating for you all.  Heartland has an ongoing Baseline project that contains many of the tools and systems we took for granted in Portal Engine, and part of that Baseline is what we are working on presenting to the community as an updated Boilerplate.  This is one of the big reasons why Part 2 is delayed, as part of the Part 2 blog I wish to release this Baseline to the general public on the HBS Github repository.  We are getting closer to seeing that accomplished now that the basic User management systems are almost built (login, log out, reset password, recover lost password, create an account with email verification).  As we also continue to perfect our MVC strategy and structure we are updating the baseline to match, so hopefully soon that will be finished, and I can finish up my Part 2 site build.

Thanks for your patience

Thanks everyone for your patience as I continue to balance work, community efforts, and home efforts.  Hopefully by this time next month the next blog article and project will be complete and published.  I know many are still struggling making MVC sites with Kentico 12, and I hope that this will help.
 
Comments
Blog post currently doesn't have any comments.
Is one = one ? (true/false)
CONTENTEND