c# - Passing List<int> with more then 10 lac records in function parameter? -
i have situation have more 10 lac record in database. , when user hit action method in mvc selected records want check whether these records present in database or not fetching record , comparing them record passed user.
then want pass record function. safe pass many record in function parameter??
here demo :-
//action method [httpget] public actionresult saverecords(list<int> selectedrecords) { list<int> allrecordsfromdb = _db.getallrecords(); if(allrecordsfromdb.contains(selectedrecords)) { _process(allrecordsfromdb); //here passing more 10 lac devices function parameter } } private void _process(list<int> allrecords) { //do process here }
thanks :)
yes safe.
as phil said "as list passing reference list of items , not actual items themselves."
another solution can put records in session or cache(according use-case) , can access anywhere ..no need pass records parameter.
Comments
Post a Comment