Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ private MethodBodyStatement[] BuildAsPagesMethodBody()
Declare("result", ResponseModelType, responseVariable.CastTo(ResponseModelType), out var resultVariable),
};

var nextPageExpression = _paging.NextLink != null ? nextPageVariable.NullConditional().Property("AbsoluteUri") : nextPageVariable;
ValueExpression nextPageExpression = _paging.NextLink != null
? new TernaryConditionalExpression(
nextPageVariable.NullConditional().Property(nameof(Uri.IsAbsoluteUri)).Equal(True),
nextPageVariable.Property(nameof(Uri.AbsoluteUri)),
nextPageVariable.NullConditional().Property(nameof(Uri.OriginalString)))
: nextPageVariable;
if (_isProtocol)
{
// Convert items to BinaryData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public CatClientGetCatsCollectionResult(global::Samples.CatClient client, int? m
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
nextPage = result.NextCat;
if ((nextPage == null))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public CatClientGetCatsCollectionResult(global::Samples.CatClient client, int ma
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
nextPage = result.NextCat;
if ((nextPage == null))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public CatClientGetCatsCollectionResult(global::Samples.CatClient client, global
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
nextPage = result.NextCat;
if ((nextPage == null))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public CatClientGetCatsAsyncCollectionResult(global::Samples.CatClient client, g
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
nextPage = result.NextCat;
if ((nextPage == null))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CatClientGetCatsCollectionResultOfT(global::Samples.CatClient client, glo
yield break;
}
global::Samples.Models.Page result = ((global::Samples.Models.Page)response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
nextPage = result.NextCat;
if ((nextPage == null))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public CatClientGetCatsAsyncCollectionResultOfT(global::Samples.CatClient client
yield break;
}
global::Samples.Models.Page result = ((global::Samples.Models.Page)response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
nextPage = result.NextCat;
if ((nextPage == null))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public CatClientGetCatsCollectionResultOfT(global::Samples.CatClient client, glo
yield break;
}
global::Samples.Models.Page result = ((global::Samples.Models.Page)response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
string nextPageString = result.NextCat;
if (string.IsNullOrEmpty(nextPageString))
{
yield break;
}
nextPage = new global::System.Uri(nextPageString);
nextPage = new global::System.Uri(nextPageString, global::System.UriKind.RelativeOrAbsolute);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public CatClientGetCatsCollectionResult(global::Samples.CatClient client, global
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
string nextPageString = result.NextCat;
if (string.IsNullOrEmpty(nextPageString))
{
yield break;
}
nextPage = new global::System.Uri(nextPageString);
nextPage = new global::System.Uri(nextPageString, global::System.UriKind.RelativeOrAbsolute);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public CatClientGetCatsCollectionResult(global::Samples.CatClient client, global
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
if ((response.Headers.TryGetValue("nextCat", out string value) && !string.IsNullOrEmpty(value)))
{
nextPage = new global::System.Uri(value);
nextPage = new global::System.Uri(value, global::System.UriKind.RelativeOrAbsolute);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public CatClientGetCatsAsyncCollectionResult(global::Samples.CatClient client, g
{
items.Add(global::System.ClientModel.Primitives.ModelReaderWriter.Write(item, global::Samples.ModelSerializationExtensions.WireOptions, global::Samples.SamplesContext.Default));
}
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::System.BinaryData>.FromValues(items, (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
if ((response.Headers.TryGetValue("nextCat", out string value) && !string.IsNullOrEmpty(value)))
{
nextPage = new global::System.Uri(value);
nextPage = new global::System.Uri(value, global::System.UriKind.RelativeOrAbsolute);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public CatClientGetCatsCollectionResultOfT(global::Samples.CatClient client, glo
yield break;
}
global::Samples.Models.Page result = ((global::Samples.Models.Page)response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
if ((response.Headers.TryGetValue("nextCat", out string value) && !string.IsNullOrEmpty(value)))
{
nextPage = new global::System.Uri(value);
nextPage = new global::System.Uri(value, global::System.UriKind.RelativeOrAbsolute);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public CatClientGetCatsAsyncCollectionResultOfT(global::Samples.CatClient client
yield break;
}
global::Samples.Models.Page result = ((global::Samples.Models.Page)response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), nextPage?.AbsoluteUri, response);
yield return global::Azure.Page<global::Samples.Models.Cat>.FromValues(((global::System.Collections.Generic.IReadOnlyList<global::Samples.Models.Cat>)result.Cats), (nextPage?.IsAbsoluteUri == true) ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
if ((response.Headers.TryGetValue("nextCat", out string value) && !string.IsNullOrEmpty(value)))
{
nextPage = new global::System.Uri(value);
nextPage = new global::System.Uri(value, global::System.UriKind.RelativeOrAbsolute);
}
else
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading