Azure, DevOps and .NET articles

Empowering developers since 2015. Real articles, real insights.

DotNet61 Azure45 DevOps35 JavaScript23 VisualStudio17 CSS12 Jekyll8 Git8 All topics →

    Prevent binding of UI-only properties to a .NET Core MVC model

    We are dealing here with a security risk for your .NET Core application. Suppose you are having the following MVC model in your .NET application and the user can edit in a UI-form her Firstname and Lastname. The property Age cannot be edited on the form. The business logic tells us that it will be filled later. However, the user, with the help of simple tools such as Postman or Google console debugger can edit the Age property. Let us see how we can block such actions.

    Read the complete article

    Copy data files to the MSTest TestResults folder

    When running unit-tests you will often want to read data from .txt or .xml files. On the runtime, these files have to be copied to the TestResults folder. By choosing Copy to Output Directory: Copy always or Build Action: embedded Resource for these files will not help and the file is not found when the unit-test runs.

    Read the complete article

    Configure Gulp to compile, minify, and concatenate SASS into CSS

    Even though Gulp is a bit outdated task runner in web development, I am an old user of it, trust it and use it for the CSS generation in my blog. In this article we are going to see how I convert the SASS code into CSS, sanitize it and minify it.

    Read the complete article

    Enable the possible null reference warnings in Visual Studio

    All .NET programmers had dealt at least once on their career with a null reference exception on a code line they wrote. Most of the times a parameter of a method is null, the code is not aware of it and the parameter is being used inside the method, for example we are accessing a property of an object. Because the value of the object is null we are getting an exception on the runtime.

    Visual Studio provides a way to inform / warn us about possible null references. Let us see how we can enable this feature on our C# project.

    Read the complete article

    The implicit operator in C# and when it can be useful

    A cool feature of C# that I lately used is the implicit operator keywords and with them we can define the way for converting one type into another one implicitly. A good scenario when you can use that is presented in this example.

    Read the complete article