A Visual Studio extension to automate code authoring for the Dynamics AX Commerce Runtime
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CommerceRuntimeHandyman
Handyman
HandymanTests
docs/imgs
.gitattributes
.gitignore
CommerceRuntimeHandyman.sln
LICENSE.txt
README.html
README.md

README.md

Commerce Runtime Handyman

A Visual Studio extension to automate code authoring for the Microsoft Dynamics AX Commerce Runtime framework.

Please report any issues here.

Supported versions

Currently supporting:

  • Visual Studio 2017 15.1 (26403.7)

Installation

You can install it:

  • from the Visual Studio Gallery page
  • or by searching by Commerce Runtime Handyman in Visual Studio -> Tools -> Extensions and Updates

Features

  • Set default project for creation of request and response classes
  • Create request and response classes out of method definition, including documentation
  • Navigate to the RequestHandler that implements a request type

Quick start

Navigate to the RequestHandler that implements a Request type

  1. Right click on a variable or type for a Request and then select Navigate to request handler's implementation. Alternatively, you can use the shortcut Ctrl+F12 when the carret is over the variable or type.

Right click on the type and select Navigate to request handler's implementation

Generating request-response classes

  1. Set a default project in the solution where request and reponse classes are to be created in by right clicking on the project in the solution explorer and selecting Commerce Runtime Handyman -> Set as default Request-Response project*

Set default project

  1. Use the light bulb suggestion Create or update request/response to generate request response classes out of a method definition

Create request-response out off method

For this snippet:

/// <summary>
/// Gets a product.
/// </summary>
/// <param name="productId">The product id.</param>
/// <param name="someOtherResponseData">The first result.</param>
/// <returns>The found product.</returns>
public Product GetProducts(long productId, out string someOtherResponseData)
{
    someOtherResponseData = "I will be on the response definition as well";
    return new Product();
}

The following request will be generated:

/// <summary>
/// Gets a product.
/// </summary>
public class GetProductsRequest : IRequest
{
    /// <summary>
    /// Initializes a new instance of the <see cref="GetProductsRequest"/> class.
    /// </summary>
    /// <param name="productId">The product id.</param>
    public GetProductsRequest(long productId)
    {
        this.ProductId = productId;
    }    

    /// <summary>
    /// Gets the product id.
    /// </summary>
    public long ProductId { get; private set; }
}

And following response will be generated:

/// <summary>
/// The response for <see cref="{GetProductsRequest}" />.
/// </summary>
public class GetProductsResponse : IResponse
{
    /// <summary>
    /// Initializes a new instance of the <see cref="GetProductsResponse"/> class.
    /// </summary>
    /// <param name="Product">The found product.</param>
    /// <param name="someOtherResponseData">The first result.</param>
    public GetProductsResponse(Product product, string someOtherResponseData)
    {
        this.Product = product;
        this.SomeOtherResponseData = someOtherResponseData;
    }    

    /// <summary>
    /// Gets the found product.
    /// </summary>
    public Product Product { get; private set; }

    /// <summary>
    /// Gets the first result.
    /// </summary>
    public string SomeOtherResponseData { get; private set; }
}

Settings

You can configure the extension settings at Tools -> Options -> Commerce Runtime Handyman

Handyman settings

Contributing

Please report issues and submit open pull requests here.

To build and run the extension, you will need to install Visual Studio SDK.