Azure, DevOps and .NET articles

Empowering developers since 2015. Real articles, real insights.

DotNet61 Azure45 DevOps36 JavaScript23 VisualStudio17 CSS12 Jekyll8 Git8 All topics →

    Use the fileinputname parameter in Visual Studio item templates

    A Visual Studio Item Template allows us to generate new files with code, so that we avoid having to manually create them. This automatization is very practical when we need to create similar classes more than one time. A template is being offered as option in the “Add new item” dialog of Visual Studio:

    Add new item dialog in visual studio

    Read the complete article

    Skip mapping between source and target properties in AutoMapper

    As I did in my previous article, I focus again on the AutoMapper framework.

    When I map one object to another, I often deal with a destination object that contains LESS properties than the source object. If I take no action, an exception is going to be thrown. For that we will have to declare the skipped properties by using the DoNotValidate method when we define the mapping (CreateMap) between the two objects:

    Read the complete article

    Use a custom function to map one property to another with AutoMapper

    Automapper is a handful tool for mapping the properties of two different type objects together. Such mappings are very common when you are dealing with a multi-tier architecture in your program. For example you want to map the entity object, which contains data from the database, with the UI-model object of your WebApi action.

    For basic mapping examples refer to the Automapper documentation. In this article we will consider the following advanced example:

    For that you need a mapping between two properties of different type and also a function that runs every time to do this transformation:

    Read the complete article

    Clone an Azure DevOps Git Repository from the Command Line

    In order to download and use a remote repository, which is stored in Azure DevOps, do the following two steps and you are good to go.

    Read the complete article

    Fix the .NET MVC "view or its master was not found" error

    “The view XXXX or its master was not found” error looks like that:

    "The view 'XXXX' or its master was not found or no view engine supports the searched locations. 
    The following locations were searched:
    ~/Areas/XXXX/Views/XXXX/XXXX.cshtml
    ~/Areas/XXXX/Views/XXXX/XXXX.vbhtml
    ~/Areas/XXXX/Views/Shared/XXXX.cshtml
    ~/Areas/XXXX/Views/Shared/XXXX.vbhtml
    ~/Views/XXXX/XXXX.cshtml
    ~/Views/XXXX/XXXX.vbhtml
    ~/Views/Shared/XXXX.cshtml
    ~/Views/Shared/XXXX.vbhtml"
    

    and I recently had to deal with it, although I was 100% sure that my view was in the right place inside my MVC project.

    Read the complete article