-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.html
116 lines (110 loc) · 5.33 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html>
<head>
<title>Commerce Runtime Handyman</title>
</head>
<body>
<h1 id="commerce-runtime-handyman">Commerce Runtime Handyman</h1>
<p>A Visual Studio extension to automate code authoring for the <a href="https://ax.help.dynamics.com/en/wiki/commerce-runtime-overview/">Microsoft Dynamics AX Commerce Runtime</a> framework.</p>
<p>Please report any issues <a href="https://github.com/andreesteve/crthandyman/issues">here</a>.</p>
<h2 id="supported-versions">Supported versions</h2>
<p>Currently supporting:</p>
<ul>
<li>Visual Studio 2017 15.1 (26403.7)</li>
<li>Visual Studio 2019 16.9 (693.2781)</li>
</ul>
<h2 id="installation">Installation</h2>
<p>You can install it:</p>
<ul>
<li>from the <a href="https://marketplace.visualstudio.com/vsgallery/fa0e1a03-00a7-45db-a6ef-dab456be41fd">Visual Studio Gallery page</a></li>
<li>or by searching by <strong>Commerce Runtime Handyman</strong> in <em>Visual Studio -> Tools -> Extensions and Updates</em></li>
</ul>
<h2 id="features">Features</h2>
<ul>
<li>Set default project for creation of <em>request</em> and <em>response</em> classes</li>
<li>Create <em>request</em> and <em>response</em> classes out of method definition, including documentation</li>
<li>Navigate to the <em>RequestHandler</em> that implements a <em>request</em> type</li>
</ul>
<h2 id="quick-start">Quick start</h2>
<h3 id="navigate-to-the-requesthandler-that-implements-a-request-type">Navigate to the RequestHandler that implements a Request type</h3>
<ol>
<li>Right click on a variable or type for a <em>Request</em> and then select <strong>Navigate to request handler's implementation</strong>. Alternatively, you can use the shortcut <strong>Ctrl+F12</strong> when the carret is over the variable or type.</li>
</ol>
<p><img src="docs/imgs/gotoimplementation.png" alt="Right click on the type and select Navigate to request handler's implementation" /></p>
<h3 id="generating-request-response-classes">Generating request-response classes</h3>
<ol>
<li>Set a default project in the solution where <em>request and reponse</em> classes are to be created in
by right clicking on the project in the solution explorer and selecting <strong>Commerce Runtime Handyman -> Set as default Request-Response project</strong>*</li>
</ol>
<p><img src="docs/imgs/set_default_project.png" alt="Set default project" /></p>
<ol start="2">
<li>Use the light bulb suggestion <strong>Create or update request/response</strong> to generate request response classes out of a method definition</li>
</ol>
<p><img src="docs/imgs/create-request-response.png" alt="Create request-response out off method" /></p>
<p>For this snippet:</p>
<pre><code class="language-csharp">/// <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();
}
</code></pre>
<p>The following request will be generated:</p>
<pre><code class="language-csharp">/// <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; }
}
</code></pre>
<p>And following response will be generated:</p>
<pre><code class="language-csharp">/// <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; }
}
</code></pre>
<h2 id="settings">Settings</h2>
<p>You can configure the extension settings at <strong>Tools -> Options -> Commerce Runtime Handyman</strong></p>
<p><img src="docs/imgs/options_view.png" alt="Handyman settings" /></p>
<h2 id="contributing">Contributing</h2>
<p>Contributions are welcomed! Please report issues and submit pull requests <a href="https://github.com/andreesteve/crthandyman">here</a>.</p>
<p>To build and run the extension, you will need to <a href="https://msdn.microsoft.com/en-us/library/mt683786.aspx">install Visual Studio SDK</a>.</p>
</body>
</html>