I will start working on xamarin soon and pass a lot of code from the java java developer in C #.
In java, I use custom classes that are given argument conditions, etc., convert them to SQL statements and then load the results into project model objects
I'm not sure linq is the best option for filtering such data.
For example, what will happen now in these lines
List<Customer> customers = (new CustomerDAO()).get_all()
Or if I have a condition
List<Customer> customers = (new CustomerDAO()).get(new Condition(CustomerDAO.Code, equals, "code1")
Now suppose I transferred classes to C # and I want to do something similar to the second case.
So, I will probably write something like:
var customers = from customer in (new CustomerDAO()).get_all() where customer.code.equals("code1") select customer
I know that the request will be executed only when I really try to contact clients, but if I have several calls to clients (let's say that I use 4 foreach loops later), will the get_all method be called 4 times? or results saved on first run?
Also, is it more efficient (in time because it is reasonable for memory, probably not) to just save the get_all () method and use linq to filter the results? Or use my existing installation, which actually performs
Select * from Customers where code = 'code1'
And loads the results into an object?
Thanks in advance for any help you can provide.
Edit: yes. I know that there is sqlite.net that pretty much does what my daos do, but probably better, and at some point I will probably convert all my objects to use it, I just need to know for the sake of knowing