34
1
using System;
2
using t = System.Threading.Tasks;
3
using Dime.Scheduler.Sdk;
4
using Dime.Scheduler.Sdk.Import;
5
6
public class Program
7
{
8
public static async t.Task Main()
9
{
10
try
11
{
12
Console.WriteLine("Adding/updating a category to Dime.Scheduler");
13
14
// Step #1 is to define the variables
15
const string uri = "http://ds-vnext-test.azurewebsites.net/";
16
const string user = "hello@dimescheduler.com";
17
const string pw = "q3EeCt5mXu'f!uE";
18
19
// Step #2 is to instantiate and create an authenticated endpoint
20
IAuthenticator authenticator = new FormsAuthenticator(uri, user, pw);
21
DimeSchedulerClient client = new(uri, authenticator);
22
IImportEndpoint importEndpoint = await client.Import.Request();
23
24
// Step #3 is to construct the import model and invoke the request
25
string name = "Hello from .NET Fiddle!";
26
Category category = new() { DisplayName = name, Name = name, Color = "#a185f0" };
27
await importEndpoint.ProcessAsync(category, TransactionType.Append);
28
}
29
catch (Exception ex)
30
{
31
Console.WriteLine("Something went wrong: " + ex.Message);
32
}
33
}
34
}
Cached Result
Compilation error (line 15, col 35): Method must have a return type
Compilation error (line 15, col 35): More than one protection modifier
Compilation error (line 22, col 6): The name 'pyramidCount' does not exist in the current context
Compilation error (line 23, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 24, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 25, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 26, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 27, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 15, col 35): More than one protection modifier
Compilation error (line 22, col 6): The name 'pyramidCount' does not exist in the current context
Compilation error (line 23, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 24, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 25, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 26, col 4): The name 'pyramidCount' does not exist in the current context
Compilation error (line 27, col 4): The name 'pyramidCount' does not exist in the current context