Skip to content
Snippets Groups Projects
Program.cs 1.15 KiB
Newer Older
using System;
using FitConnect;
using FitConnect.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

Client client;


void FluentSenderCall() {
    client.Sender
        .WithDestination("destinationId")
        .WithAttachments(Array.Empty<Attachment>())
        .WithData("")
        .Submit();

    client.Sender
        .WithDestination("destinationId")
        .WithAttachments(Array.Empty<Attachment>())
        .Submit();
}

void FluentSubscriberCall() {
    var submissions = client.Subscriber
        .GetAvailableSubmissions();

    client.Subscriber.RequestSubmission("submissionId")
        .GetAttachments((attachments => {
            // Check if the attachments are valid
            return true;
        }));
}


ILogger _logger = new Logger<AppDomain>(new NullLoggerFactory());
client = new Client(
    FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development), _logger);

Console.WriteLine(
    "This is a dummy client to demonstrate the usage of the FitConnect SDK for .NET");

client =
    new Client(FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development),
        logger: _logger);