You must Sign In to post a response.
  • Category: LINQ

    Please suggest correct patter for best in performance

    hi,
    i am write a code for fetching records using stored procedure.
    pattern 1:-
    var objList = db.SP_GetHotelcustomseting(propertyId, modulebyId).ToList();
    return objList;
    pattern 2:-
    var objList = (from P in _db.SP_GetHotelcustomseting(propertyId, modulebyId)
    select P).ToList();
    return objList;

    please suggest to me which is best.

    thanks & regards,
    Atul Sharma
  • #762182
    Hi

    I think this is best

    pattern 1:-
    var objList = db.SP_GetHotelcustomseting(propertyId, modulebyId).ToList();
    return objList;

    because Stored procedure pre compiler so we have fetch data quickly

    your pattern 2 like select query so this is execute normal query so this we no need use this type

    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.


  • Sign In to post your comments