Created
April 15, 2021 10:38
-
-
Save gistlyn/d3a0dfcd0851d928badad66b90affc06 to your computer and use it in GitHub Desktop.
Chinook Query Artists Example
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.Client" Version="5.*" /> | |
<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
/* Options: | |
Date: 2021-04-14 07:49:13 | |
Version: 5.105 | |
Tip: To override a DTO option, remove "//" prefix before updating | |
BaseUrl: https://chinook.netcore.io | |
GlobalNamespace: ChinookQueryArtists | |
//MakePartial: True | |
//MakeVirtual: True | |
//MakeInternal: False | |
//MakeDataContractsExtensible: False | |
//AddReturnMarker: True | |
//AddDescriptionAsComments: True | |
//AddDataContractAttributes: False | |
//AddIndexesToDataMembers: False | |
//AddGeneratedCodeAttributes: False | |
//AddResponseStatus: False | |
//AddImplicitVersion: | |
//InitializeCollections: True | |
//ExportValueTypes: False | |
IncludeTypes: QueryArtists.* | |
//ExcludeTypes: | |
//AddNamespaces: | |
//AddDefaultXmlNamespace: http://schemas.servicestack.net/types | |
*/ | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Runtime.Serialization; | |
using ServiceStack; | |
using ServiceStack.DataAnnotations; | |
using ChinookQueryArtists; | |
namespace ChinookQueryArtists | |
{ | |
[Route("/artists", "GET")] | |
[Route("/artists/{ArtistId}", "GET")] | |
public partial class QueryArtists | |
: QueryDb<Artists>, IReturn<QueryResponse<Artists>>, IGet | |
{ | |
public QueryArtists() | |
{ | |
ArtistIdBetween = new long[]{}; | |
} | |
public virtual long? ArtistId { get; set; } | |
public virtual long[] ArtistIdBetween { get; set; } | |
public virtual string NameStartsWith { get; set; } | |
} | |
public partial class Artists | |
{ | |
public virtual long ArtistId { get; set; } | |
public virtual string Name { get; set; } | |
} | |
} | |
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; | |
using System.Collections.Generic; | |
using ServiceStack; | |
using ServiceStack.Text; | |
using ChinookQueryArtists; | |
var client = new JsonServiceClient("https://chinook.netcore.io"); | |
var response = client.Send(new QueryArtists { | |
ArtistIdBetween = new[] { 1L, 100L }, | |
NameStartsWith = "F", | |
}); | |
response.PrintDump(); | |
Inspect.vars(new { response }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment