Perfomance Issue RRS feed

  • Question

  • I'm developing an application using Entity Framework but instead declare each entity to save in each form I'm using dynamic variable in form class, is there a perfomance issue, coding like this and is there a better solution ?
    dynamic current = bs_active.Current;
    try {current.USERID = GlobalVariable.cUserLogin;}catch(Exception){}
    try {current.DATECR = DateTime.Now;}catch(Exception){}

    bs_active is binding souce with the datasource is objectentity each table/entity have fields USERID and DATECR

    any help/comment please ?


    • Edited by ngherry Saturday, December 1, 2012 9:01 AM mistype
    Saturday, December 1, 2012 8:54 AM

All replies

  • Hi,

    Why do you not use Entity type directly?

    Yes, dynamic variable have little performance influence at the first time execution, because compiler treats dynamic variable like Object, which may cause the additional box and unbox operations.

    Tuesday, December 4, 2012 3:09 AM
  • thx for your information, I did not use entity type directly because as far as I know it's need to declare each entity for Save action, if I have 100 table for transaction I need to write codes to these 100 tables for SAVE operation, so it's so many line of code.

    Please correct me if i wrong.

    Tuesday, December 4, 2012 11:33 AM