Last active
May 16, 2021 16:56
-
-
Save gistlyn/3f4a82c3802da7ac1d1adcf31e050977 to your computer and use it in GitHub Desktop.
ServiceStack.Text - .NET's missing high-performance utility belt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
<NoWarn>1591</NoWarn> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="ServiceStack.Common" Version="5.*" /> | |
</ItemGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using ServiceStack; | |
using ServiceStack.Text; | |
var orgName = "ServiceStack"; | |
var orgRepos = $"https://api.github.com/orgs/{orgName}/repos" | |
.GetJsonFromUrl(httpReq => httpReq.UserAgent = "Gistlyn") | |
.FromJson<GithubRepository[]>() | |
.OrderByDescending(x => x.Watchers) | |
.Take(5) | |
.ToList(); | |
$"Top 5 {orgName} Github Repositories:".Print(); | |
orgRepos.PrintDump(); | |
public class GithubRepository | |
{ | |
public string Name { get; set; } | |
public string Description { get; set; } | |
public string Url { get; set; } | |
public string Homepage { get; set; } | |
public string Language { get; set; } | |
public int Watchers { get; set; } | |
public int Forks { get; set; } | |
public override string ToString() => Name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment