0

I need to get from the table "TableTest". "ID" of the string "DollarTest" where the value is "DollarTest" between "50.20" and "40" AND the value is "Euro Test" between "60" and "70.50"

How to do this for SQLite Xamarin forms?

IDGet = (await App.Database.GetItemsAsync()).Where(x => )

... I don’t understand how to implement this at all. Is it possible to make this query in MySQL and use it? How?

'TableTest', 'DollarTest BETWEEN 50.20 AND 40 AND EuroTest BETWEEN 60 AND 70.50'
alexandr f
  • 183
  • 16
  • Does this answer your question? ["Between" in Linq C#](https://stackoverflow.com/questions/2271509/between-in-linq-c-sharp) – Drag and Drop Nov 26 '19 at 09:40

1 Answers1

1

I would split them in two separate calls to make it more clear in the code so for me it would look something like this:

var IDGetDollar = db.Where(x => x.Type == "DollarTest" && x.Value < 50.20 && x.Value > 40).ToList();

var IDGetEuro = db.Where(x => x.Type == "Euro Test" && x.Value < 70.50 && x.Value > 60).ToList();

You could then just add them together if you prefer later on instead of building a over complicated one query call.

Threezool
  • 453
  • 4
  • 11