mirror of
https://github.com/Tribufu/TribufuDotNet
synced 2026-08-09 21:01:07 +00:00
Migrate to new tribufu project structure
This commit is contained in:
parent
be25ee8fe3
commit
6ef2762a64
114 changed files with 35 additions and 26 deletions
36
Source/Tribufu.Example/Program.cs
Normal file
36
Source/Tribufu.Example/Program.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
using dotenv.net;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Tribufu.Client;
|
||||
using Tribufu.Logging;
|
||||
|
||||
namespace Tribufu.Test
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
Logger.Initialize(LogLevel.Trace);
|
||||
|
||||
DotEnv.Load(new DotEnvOptions(ignoreExceptions: true, envFilePaths: [".env", "../../.env"]));
|
||||
|
||||
var apiKey = Environment.GetEnvironmentVariable("TRIBUFU_API_KEY");
|
||||
var tribufu = new TribufuApi(apiKey ?? "");
|
||||
|
||||
Logger.Debug(TribufuApi.GetUserAgent());
|
||||
|
||||
try
|
||||
{
|
||||
var result = await tribufu.GetUserInfoAsync();
|
||||
Logger.Debug(result.ToString());
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Logger.Debug(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Source/Tribufu.Example/Tribufu.Example.csproj
Normal file
16
Source/Tribufu.Example/Tribufu.Example.csproj
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsPublishable>false</IsPublishable>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="dotenv.net" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Tribufu.Logging\Tribufu.Logging.csproj" />
|
||||
<ProjectReference Include="..\Tribufu\Tribufu.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Loading…
Add table
Add a link
Reference in a new issue