barrycarey / SnipeSharp

A c# wrapper for the Snipe IT API
25 stars 30 forks source link

Get information #5

Closed nathanysp closed 6 years ago

nathanysp commented 6 years ago

Hi,

I'm having some problems in get items from database, I'm just testing every possibilities yet.

For example, I need to see every assets/users that we have, so I user this code:

List<SnipeSharp.Endpoints.Models.Asset> Asset = new List<SnipeSharp.Endpoints.Models.Asset>();
            Asset = snipe.AssetManager.GetAll().Rows;

that return 30 or 40 assets, we currently have more than 700 assets.

With the uses is the same thing, we have more than 200 users, but only get 30, the code its very similar. Maybe my code its wrong, I don't know, maybe you have some documentation, that will be very helpfull.

Thank you very much.

barrycarey commented 6 years ago

It looks like the API changed to only return 50 results if no limit is set. I'll have to update this when I have time.

As a work around you should be able to use AssetManager.FindAll(). Pass in a SearchFilter with the Limit set to something higher than your total assets.

nathanysp commented 6 years ago

Ok, so I cant set up a filter, how do I do that? I already have tried with several types of data.