PartialResponseRequest.Fields 1.0.0-rc2

.NET Standard 2.0
This is a prerelease version of PartialResponseRequest.Fields.
There is a newer prerelease version of this package available.
See the version list below for details.
NuGet\Install-Package PartialResponseRequest.Fields -Version 1.0.0-rc2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
dotnet add package PartialResponseRequest.Fields --version 1.0.0-rc2
<PackageReference Include="PartialResponseRequest.Fields" Version="1.0.0-rc2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PartialResponseRequest.Fields --version 1.0.0-rc2
#r "nuget: PartialResponseRequest.Fields, 1.0.0-rc2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install PartialResponseRequest.Fields as a Cake Addin
#addin nuget:?package=PartialResponseRequest.Fields&version=1.0.0-rc2&prerelease

// Install PartialResponseRequest.Fields as a Cake Tool
#tool nuget:?package=PartialResponseRequest.Fields&version=1.0.0-rc2&prerelease

< back

Fields Queries


Selecting fields field1,field2,field3

Selecting nested fields field1{field2,field3}

Field parameters field1{field2(top:3)}

Select all fields, but only few in nested *,field2{field3}


class Model {
    public int Field1 { get; set; }
    public Nested Field2 { get; set; }

    class Nested {
        public int Field3 { get; set; }

// Parsing
var parser = new QueryParser();
List<FieldToken> result = parser.Parse("field1,field2{field3}");

// Or building tokens manually with strong type!
var builder = new FieldsBuilder<Model>();
List<FieldToken> result = builder
    .Field(x => x.Field1)
    .Nested(x => x.Field2, x => x.Field3)

// Interpreting
var interpreter = new QueryInterpreter(result);
interpreter.Includes("field1"); // returns if field1 should be included

var nested = interpreter.Visit("field2"); // returns a nested interpreter
nested.Includes("field3"); // returns if you need to include field2.field3 

// Interpreter could be wrapped to support strong type
var interpreter2 = new QueryInterpreter<Model>(interpreter);
interpreter2.Includes(x => x.Field1);
var nested = interpreter2.Visit(x => x.Field2);
nested.Includes(x => x.Field3);

// Serialize back into string query
var serializer = new FieldsSerializer();
string query = serializer.Serialize(result); // field1,field2{field3}
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PartialResponseRequest.Fields:

Package Downloads

ASP.NET Web API JSON output formatter for partial response

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.2-beta 2,474 2/28/2021
1.1.0-beta 290 6/13/2020
1.0.0-rc2 251 3/8/2020
1.0.0-rc 424 3/7/2020