You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DAX Formatter is a service available at https://www.daxformatter.com
5
-
The service receives DAX expressions and format them according to rules for [DAX code formatting](https://www.sqlbi.com/articles/rules-for-dax-code-formatting/)
5
+
The service receives DAX expressions and format them according to rules for [DAX code formatting](https://www.sqlbi.com/articles/rules-for-dax-code-formatting/).
6
6
The NuGet package contains a client library to invoke the serivce from your .NET application.
7
7
All the requests are designed to be asynchronous.
8
-
You should minimize the requests made to the service: to format multiple expressions, use a single API call providing the DaxFormatterMultipleRequest structure.
8
+
You should minimize the requests made to the service: to format multiple expressions, use a single API call providing the `DaxFormatterMultipleRequest` structure.
9
9
10
10
# Quick guide
11
-
Create an instance of DaxFormatterClient.
12
-
Invoke the FormatAsync method for each request.
13
-
Possibly, use the DaxFormatterMultipleRequest structure to provide more statistical details about the database and the server (all the names are anonymized and used only to count the number of unique servers/databases serviced).
14
-
11
+
Create an instance of `DaxFormatterClient`.
12
+
Invoke the `FormatAsync` method for each request.
13
+
Possibly, use the `DaxFormatterMultipleRequest` structure to provide more statistical details about the database and the server (all the names are anonymized and used only to count the number of unique servers/databases serviced).
15
14
16
15
# DaxFormatterClient
17
16
18
17
The default constructor creates an instance of the client using the current assembly name and version to identify the client. You can specify an application name and version in the constructor arguments.
19
18
The client instance resolve the server endpoint just once and reuse it in following requests.
20
19
It is suggested to reuse the same instance in multiple requests to minimize the latency.
21
-
`var formatter = new DaxFormatterClient();
22
-
var response1 = await formatter.FormatAsync( "evaluate('Table') order by 'Table'[Column]" );`
23
-
20
+
```csharp
21
+
varformatter=newDaxFormatterClient();
22
+
varresponse1=awaitformatter.FormatAsync( "evaluate('Table') order by 'Table'[Column]" );
23
+
```
24
24
# DaxFormatterMultipleRequest
25
-
Use the DaxFormatterMultipleRequest class to send multiple DAX expressions in a single API call.
26
-
```var formatter = new DaxFormatterClient();
25
+
Use the `DaxFormatterMultipleRequest` class to send multiple DAX expressions in a single API call.
26
+
```csharp
27
+
varformatter=newDaxFormatterClient();
27
28
varrequest=newDaxFormatterMultipleRequest
28
-
{
29
-
DatabaseName = "MyDatabaseName", // The name will be anonymized by the client library
30
-
ServerName = "MyServerName", // The name will be anonymized by the client library
31
-
32
-
// Format arguments (you can skip all of them to keep the default values)
0 commit comments