Getting started with Unicorn serialization for Sitecore – Part 1

I decided to write a series of articles about Unicorn serialization and how to configure it in a Sitecore SXA project. This article is the first one in the series and is just a brief introduction to Unicorn explaining basic concepts, mostly directed towards people that used different serialization tools in the past and are just starting with Unicorn. If you are familiar with the basics you can jump straight away to part 2 where I cover serialization for SXA in detail. In the configuration examples, for the purpose of this article, I used Sitecore 9.0.2 with Unicorn 4.0.2 with…

Read More

Elegant one-line way to use TryParse

I don't know how about you, but for me using int.TryParse() always feel somehow not right, resulting in an ugly three lines of code to do just one operation: int value; if (!int.TryParse(valueToParseFromString, out value) value = 0; If you are looking for cleaner code to satisfy your inner pedant you can use this one-line solution instead: int value = int.TryParse(valueToParseFromString, out value) ? value : 0; It will parse the valueToParseFromString and on success assign it to the value variable, otherwise it will return 0.

Read More