ComicVineApi
1.0.0
멋진 Comic Vine REST API를 래핑하는 아름다운 .NET API입니다.
https://comicvine.com/api의 API 키가 필요합니다.
정보를 찾거나 가져오는 세 가지 주요 방법은 다음과 같습니다.
각 리소스에 대해 한 줄의 코드로 특정 항목을 쉽게 요청할 수 있습니다.
// create the client
var client = new ComicVineClient ( " <API-KEY> " , " <CUSTOM-USER-AGENT> " ) ;
// request the Batgirl (Cassandra Cain) character
var cassie = await client . Character . GetAsync ( 65230 ) ;
// print something out
Console . WriteLine ( $" { cassie . Name } was born on { cassie . Birth } . " ) ;
값이 포함된 기본 필터:
// create the client
var client = new ComicVineClient ( " <API-KEY> " , " <CUSTOM-USER-AGENT> " ) ;
// request the female Cain family characters
var females = client . Character . Filter ( )
. WithValue ( x => x . Name , " Cain " )
. WithValue ( x => x . Gender , Gender . Female ) ;
// fetch the first result (all fields)
var first = await females . FirstOrDefaultAsync ( ) ;
// print something out
Console . WriteLine ( $" { first . Name } was born on { first . Birth } . " ) ;
더 작은 페이로드를 위해 축소된 필드로 필터링:
// create the client
var client = new ComicVineClient ( " <API-KEY> " , " <CUSTOM-USER-AGENT> " ) ;
// request the female Cain family characters
var females = client . Character . Filter ( )
. WithValue ( x => x . Name , " Cain " )
. WithValue ( x => x . Gender , Gender . Female ) ;
// just fetch minimal data (id, name, birth)
var smallPayload = females
. IncludeField ( x => x . Id )
. IncludeField ( x => x . Name )
. IncludeField ( x => x . Birth ) ;
// fetch all the results on the page
var page = await smallPayload . ToListAsync ( ) ;
// fetch all the items on all the pages
foreach ( var character in page )
{
// print something out
Console . WriteLine ( $" { character . Name } was born on { character . Birth } . " ) ;
}
여러 API 호출을 통해 서버의 모든 결과를 반복합니다.
// create the client
var client = new ComicVineClient ( " <API-KEY> " , " <CUSTOM-USER-AGENT> " ) ;
// request the female Cain family characters
var females = client . Character . Filter ( )
. WithValue ( x => x . Name , " Cain " )
. WithValue ( x => x . Gender , Gender . Female ) ;
// fetch all the items on all the pages
await foreach ( var character in filter . ToAsyncEnumerable ( ) )
{
// print something out
Console . WriteLine ( $" { character . Name } was born on { character . Birth } . " ) ;
}
TODO: 문서 추가
TODO: 문서 추가