bgmulinari / B1SLayer

A lightweight SAP Business One Service Layer client for .NET
MIT License
138 stars 47 forks source link

inlinecount #33

Closed WitmondPaul closed 1 year ago

WitmondPaul commented 1 year ago

Hi Bruno,

Is it possible to add the inlinecount to the request ?

example : https://api.demoserver:50000/b1s/v2/Users?$select=UserCode,UserName&$inlinecount=allpages

result from Postman : image

In Postman it's working fine.

I know you have GetCountAsync() but I don't want to make 2 call's when only 1 is enough

bgmulinari commented 1 year ago

Hi, @WitmondPaul.

Thanks for your suggestion. I'll evaluate how to implement this feature for the next release.

bgmulinari commented 1 year ago

Hi, @WitmondPaul.

I just pushed a commit to the dev branch that adds a new request method called GetWithInlineCountAsync(). It returns a value tuple containing the result and the count.

If you are able to test it, please let me know if it works for you.

WitmondPaul commented 1 year ago

Hi Bruno,

How do I get the new version ? On Github it’s still 1.3.0

Best regards / Met vriendelijke groet,

Paul Witmond

Planlogic B.V. | Bolderweg 2 | 1332 AT Almere | T. +31 (0)36 3030003| M. +31 (0)627 096 016| KvK 11033102 @.*** Volg ons online: www.planlogic.nlhttp://www.planlogic.nl/ | LinkedInhttps://www.linkedin.com/company/planlogic-b-v- | Facebookhttps://www.facebook.com/PlanlogicNederland/

The contents of this message, as well as any enclosures, are addressed personally to, and thus solely intended for the addressee. They may contain information regarding a third party. Any recipient who is neither the addressee, nor empowered to receive this message on behalf of the addressee, is kindly requested to immediately inform the sender of receipt. Any use of the contents of this message and/or of the enclosures by any other person than the addressee is illegal towards the sender and the aforementioned third party. Always scan attachments before opening them.

Van: Bruno Mulinari @.> Verzonden: donderdag 13 april 2023 17:39 Aan: bgmulinari/B1SLayer @.> CC: Paul Witmond | Planlogic @.>; Mention @.> Onderwerp: Re: [bgmulinari/B1SLayer] inlinecount (Issue #33)

Hi, @WitmondPaulhttps://github.com/WitmondPaul.

I just pushed a commit to the dev branch that adds a new request method called GetWithInlineCountAsync(). It returns a value tuple containing the result and the count.

If you are able to test it, please let me know if it works for you.

— Reply to this email directly, view it on GitHubhttps://github.com/bgmulinari/B1SLayer/issues/33#issuecomment-1507188024, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4LY3PC2ETDX3HTUUQFVBRTXBAMYPANCNFSM6AAAAAAWVPWWOU. You are receiving this because you were mentioned.Message ID: @.**@.>>

bgmulinari commented 1 year ago

Hi, @WitmondPaul. You can try installing the package directly from the file below:

B1SLayer.1.3.1.nupkg.zip

WitmondPaul commented 1 year ago

Hi Bruno,

I’ve installed the new version. Can you please provide an example how to use the new function ?

Best regards / Met vriendelijke groet,

Paul Witmond

Planlogic B.V. | Bolderweg 2 | 1332 AT Almere | T. +31 (0)36 3030003| M. +31 (0)627 096 016| KvK 11033102 @.*** Volg ons online: www.planlogic.nlhttp://www.planlogic.nl/ | LinkedInhttps://www.linkedin.com/company/planlogic-b-v- | Facebookhttps://www.facebook.com/PlanlogicNederland/

The contents of this message, as well as any enclosures, are addressed personally to, and thus solely intended for the addressee. They may contain information regarding a third party. Any recipient who is neither the addressee, nor empowered to receive this message on behalf of the addressee, is kindly requested to immediately inform the sender of receipt. Any use of the contents of this message and/or of the enclosures by any other person than the addressee is illegal towards the sender and the aforementioned third party. Always scan attachments before opening them.

Van: Bruno Mulinari @.> Verzonden: vrijdag 14 april 2023 14:55 Aan: bgmulinari/B1SLayer @.> CC: Paul Witmond | Planlogic @.>; Mention @.> Onderwerp: Re: [bgmulinari/B1SLayer] inlinecount (Issue #33)

Hi, @WitmondPaulhttps://github.com/WitmondPaul. You can try installing the package directly from the file below:

B1SLayer.1.3.1.nupkg.ziphttps://github.com/bgmulinari/B1SLayer/files/11232993/B1SLayer.1.3.1.nupkg.zip

— Reply to this email directly, view it on GitHubhttps://github.com/bgmulinari/B1SLayer/issues/33#issuecomment-1508462952, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4LY3PCJZSISYSJPJ766CKDXBFCL3ANCNFSM6AAAAAAWVPWWOU. You are receiving this because you were mentioned.Message ID: @.**@.>>

bgmulinari commented 1 year ago

Hi, @WitmondPaul. Here's an example:

var items = await serviceLayer.Request("Items").GetWithInlineCountAsync<List<Item>>();

Console.WriteLine($"There are {items.Count} items in total");
Console.WriteLine("Items in the first page:");

foreach (var item in items.Result)
{
    Console.WriteLine(item.ItemCode);
}
WitmondPaul commented 1 year ago

😊

Best regards / Met vriendelijke groet,

Paul Witmond

Planlogic B.V. | Bolderweg 2 | 1332 AT Almere | T. +31 (0)36 3030003| M. +31 (0)627 096 016| KvK 11033102 @.*** Volg ons online: www.planlogic.nlhttp://www.planlogic.nl/ | LinkedInhttps://www.linkedin.com/company/planlogic-b-v- | Facebookhttps://www.facebook.com/PlanlogicNederland/

The contents of this message, as well as any enclosures, are addressed personally to, and thus solely intended for the addressee. They may contain information regarding a third party. Any recipient who is neither the addressee, nor empowered to receive this message on behalf of the addressee, is kindly requested to immediately inform the sender of receipt. Any use of the contents of this message and/or of the enclosures by any other person than the addressee is illegal towards the sender and the aforementioned third party. Always scan attachments before opening them.

Van: Bruno Mulinari @.> Verzonden: maandag 17 april 2023 15:55 Aan: bgmulinari/B1SLayer @.> CC: Paul Witmond | Planlogic @.>; Mention @.> Onderwerp: Re: [bgmulinari/B1SLayer] inlinecount (Issue #33)

Hi, @WitmondPaulhttps://github.com/WitmondPaul. Here's an example:

var items = await serviceLayer.Request("Items").GetWithInlineCountAsync<List>();

Console.WriteLine($"There are {items.Count} in total");

Console.WriteLine("Items in the first page:");

foreach (var item in items.Result)

{

Console.WriteLine(item.ItemCode);

}

— Reply to this email directly, view it on GitHubhttps://github.com/bgmulinari/B1SLayer/issues/33#issuecomment-1511400933, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4LY3PESA4LDQJQEV3WLHKDXBVDTDANCNFSM6AAAAAAWVPWWOU. You are receiving this because you were mentioned.Message ID: @.**@.>>

bgmulinari commented 1 year ago

Hi, @WitmondPaul. Were you able to test the new method? If so, please let me know.

WitmondPaul commented 1 year ago

Bruno,

Perfect !

bgmulinari commented 1 year ago

This feature was added in version 1.3.1.

Thanks for your suggestion, @WitmondPaul.