Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Balances Linq select SourceObject Type #186

Open
NinjaRaiden opened this issue Feb 8, 2023 · 2 comments
Open

Get Balances Linq select SourceObject Type #186

NinjaRaiden opened this issue Feb 8, 2023 · 2 comments

Comments

@NinjaRaiden
Copy link

Hello, I can not use linq to filter and select balances where SourceObject.Type = Trade or Main.

var x = kucoinClient.SpotApi.CommonSpotClient.GetBalancesAsync().Result;
            x.Data.Where(m => m.SourceObject.Type == ?)
@Torabi-srh
Copy link
Contributor

check the SourceObject Type its {Kucoin.Net.Objects.Models.Spot.KucoinAccount} in Spot API i think you doing it wrong.

@NinjaRaiden
Copy link
Author

check the SourceObject Type its {Kucoin.Net.Objects.Models.Spot.KucoinAccount} in Spot API i think you doing it wrong.

Yes you can check the SourceObject Type with Casting.
but you can't filter Where condition with SourceObject cause it need to casting first.

in order to achieve that:

KucoinAccount l =  (KucoinAccount) b.SourceObject;
switch (l.Type)
{
    case AccountType.Trade:{}break;
    .
    .
    .
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants