Update sample projects & samples in docs (#2823)

* update them all

* more docs

* moar docs
This commit is contained in:
Mihail Gribkov
2024-01-11 18:25:56 +03:00
committed by GitHub
parent 8227d70b86
commit e2e8c0fd6a
31 changed files with 732 additions and 806 deletions

View File

@@ -2,19 +2,18 @@ using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
namespace TextCommandFramework.Services
namespace TextCommandFramework.Services;
public class PictureService
{
public class PictureService
private readonly HttpClient _http;
public PictureService(HttpClient http)
=> _http = http;
public async Task<Stream> GetCatPictureAsync()
{
private readonly HttpClient _http;
public PictureService(HttpClient http)
=> _http = http;
public async Task<Stream> GetCatPictureAsync()
{
var resp = await _http.GetAsync("https://cataas.com/cat");
return await resp.Content.ReadAsStreamAsync();
}
var resp = await _http.GetAsync("https://cataas.com/cat");
return await resp.Content.ReadAsStreamAsync();
}
}