Friday, 15 May 2015

c# - Passing List<int> with more then 10 lac records in function parameter? -


I have a situation where I have more than 10 million records in the database and when a user has access to some selected records Together with my verb method in MVC, I want to know whether these records are present in the database or by not getting all the records and comparing them with the records passed by the user.

I want to pass all such records in another ceremony. Is it safe to pass so many records into function parameters ??

Here is a demo: -

  // Methodology [HTPGet] Public Action Result ServiceRockets (List & quot; Int & gt; Selected vacancies) {List & lt ; Int & gt; AllRecordsFromDB = _db.GetAllRecords (); If (allRecordsFromDB.Contains (selected graphs)) {_Process (allRecordsFromDB); // Here I pass more than 10 million devices in a function as a parameter}} Private zero _Process (list & lt; int & gt; allRecords) {// some process here}  

thanks

yes This will be safe.

As Phil said, "As it is a list, you are only passing a reference to the list of items, not the real things themselves."

Another solution is that you can access all recorded sessions or caches (according to your usage-case) and anywhere. There is no need to pass the record as a parameter.


No comments:

Post a Comment