C# 7 has been released by Microsoft and can be found in Visual Studio 2017. Two C# 7 features I have already mentioned include C# 7 Tuples and C# 7 Local Functions, both of which I am very excited about as I use these features quite a bit in Python. Another new feature in C# 7, but less useful to me personally, is the ability to use an underscore as a digit separator in numeric literals in C# 7. This is visually appealing and makes it easier to read the value, whether this be in decimal, hexadecimal, or binary notation.
C# Local Functions are a great new feature in C# 7. Local functions are nested functions. They are methods declared in another method and run in the context of that method. They are methods that are used only by one other method and help to keep each method small and focused.
Tuples in C# 7 and Visual Studio 2017 received a much needed facelift. I, personally, find them just as enjoyable as tuples in Python given the brevity of the new syntax, optional naming of the tuple elements (which makes a world of difference in self-documenting code), and the ability to deconstruct tuples.
I taught an advanced development class on Orchard CMS this morning, and thought I would mention a live coding example I did today. My favorite parts of Orchard CMS are the behind-the-scenes features that you don't hear too much about, like scheduling tasks, events, workflow, etc. These are incredibly powerful CMS features and most Orchard CMS Developers I talk to rarely utilize them to their fullest. In particular, I love integrating Orchard CMS with external services, especially using Workflow, because it is incredibly empowering to drag-and-drop various components onto a blank canvas to create something very rich and meaningful to your business.
If you are having issues with bots spamming your forms in Orchard CMS but don't want to use CAPTCHA, an 'old school' method I used years ago was a honeypot form field. This is a non-visible form field that users won't see and fill in. However, simple bots will detect the field and fill it in along with all the other fields on the form. Given this behavior, one can usually detect spam by checking the presence of data in that honeypot form field. If it contains data, more than likely the form was filled by a bot and you can treat it as spam.
Last time I showed how to develop a .NET Core 1.0 Console Application using Visual Studio Code on macOS. Now I want to quickly show you how to get started developing an ASP.NET Core Web Application. This can be used as the basis for learning .NET Core, ASP.NET Core, Entity Framework Core, etc. I am running this on macOS, but the dotnet CLI is cross platform and works the same way on Windows, Linux, etc.
Yesterday I briefly mentioned my experience of developing a .NET Core C# Console Application on macOS using Visual Studio Code. Since then I have made several .NET Core console applications ( and ASP.NET Core Web Apps ) for kicks and wanted to mention the steps in more detail if you are struggling with the process.
The .NET Core Framework was released yesterday from Microsoft. I installed it on my MacBook Pro and developed a small console application using Visual Studio Code. My main goal was to get a feel for using Visual Studio Code to create and debug simple console and web applications using C# on macOS for .NET Core.
In a previous blog post I mentioned creating a suite of features to support Snipcart in Orchard CMS. Since then Snipcart has released v2.0 of the shopping cart to support better customization. I made some adjustments to the Snipcart Orchard CMS Modules to support a custom shopping cart theme. Of course, to do so, I had to experience for myself what it was like to customize the Snipcart Shopping Cart in v2.0 as well as deploy it on a sample website.