none
Entity Framework SQL and profiler RRS feed

  • Question

  • Hi,

    How to apply encryption to LINQ statements,

    also how to hide the structure of queries and values and names,

    without a Stored Procedure?

    Regards.



    Please remember to mark the replies as answers if they help and unmark them if they provide no help , or you may vote-up a helpful post

    Monday, June 9, 2014 2:11 PM

All replies

  • Hello,

    >>How to apply encryption to LINQ statements

    Do you mean that you want to encryption this:

           var result = from order in db.Orders
    
                             select order;
    

    I think this is not possible to encrypt it directly, you may need to write a class which contains your queries you want to encrypt and encrypt that file. When you need to call your queries, decrypting that file and call them.

    >> also how to hide the structure of queries and values and names, without a Stored Procedure?

    Being confused about what you are asking. Could you please share sample code? Or do you query database with dynamic linq query?

    If I misunderstand, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 10, 2014 7:34 AM
    Moderator
  • Hi,

    • The code in the LINQ query in your response would be converted to

    SQL query which can also be viewed through a SQL profiler trace, if it is installed.

    Given : That db.Orders is mapped to an entity object which is linked to a database table.

    • A stored procedure hides the logic and column names and table names,

    except the parameters passed, for which again there may be custom encryption and decryption.

    Depends where it was needed or not.

    Regards.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help , or you may vote-up a helpful post

    Tuesday, June 10, 2014 8:58 AM
  • Hi,

    Sorry for replying so late.

    >> •The code in the LINQ query in your response would be converted to a SQL query which can also be viewed through a SQL profiler trace, if it is installed.

    Yes, the linq query will be translated to TSQL, however, I do not think it could be caught and encrypt the SQL string.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 12, 2014 6:58 AM
    Moderator