lundi 16 mars 2015

I have a situation where I have more then 10 lac record in database. and I when a user hit my action method in MVC with some selected records I want to check whether these records are present in database or not by fetching all the record and comparing them with record passed by user.


then I want to pass all those record to an another function. Is it safe to pass so many record in a function parameter??


Here is a demo :-



//Action Method

[HttpGet]
Public ActionResult SaveRecords(List<int> selectedRecords)
{
List<int> allRecordsFromDB = _db.GetAllRecords();
if(allRecordsFromDB.Contains(selectedRecords))
{
_Process(allRecordsFromDB); //here I am passing more than 10 lac devices to a function as parameter
}
}

Private void _Process(List<int> allRecords)
{
//Do some process here
}


Thanks :)


Aucun commentaire:

Enregistrer un commentaire