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

How would I learn to code if I could start once again

A few days ago my friend asked me a question how would I learn web development if I could start once again with my current experience and what I would do differently which inspired me to write this post. After a few years of experience as a .NET developer, I have plenty of reflections about that and I hope some of them would be a good starting point for beginners. In this article, I will assume that you want to focus on back-end development of web applications and object oriented programming. Pick only one technology and start with a good book…

Read More

Sitecore 8.2.1 on Azure PaaS Web Apps part 2: ARM Templates

As I already mentioned in the first part of the tutorial there are two ways to deploy Sitecore 8.2.1 to Azure Web Apps. In this post, I am going to talk about the second option which is installation using Azure Resource Manager Templates. Sitecore 8.2.1 ARM Deployment step by step: Install the latest version of Azure PowerShell SDK. Run PowerShell console and execute the above lines: Set-ExecutionPolicy AllSigned # Install the Azure Resource Manager modules from the PowerShell Gallery Install-Module AzureRM # Install the Azure Service Management module from the PowerShell Gallery Install-Module Azure I experienced an issue: "some modules…

Read More

Sitecore 8.2.1 on Azure PaaS Web Apps part 1: Installation using Azure Marketplace

In Sitecore 8.2 since update 1, Sitecore provided out of the box support for Azure Platform as a Service deployments. Before Sitecore 8.2.1, it was possible to deploy Sitecore using Cloud Services which required custom deployment and had a few drawbacks like no support for some Sitecore modules like WFFM or EXM, burdensome maintenance, long deployments time and requirement of integration with third-party services because of lack of automatic scaling. Since Sitecore 8.2.1 there are possible two ways of deployments: One-click deployment option using Azure Marketplace Powershell based deployment using Azure Resource Manager Templates In this post, I am going…

Read More