locked
entity framework question RRS feed

  • Question

  • User632751675 posted

    hi,

    I am working with an old sql database and a project that uses entity framwork.

    I have a stored procedure that returning a result that returns the fields with an extra 'c' character in front of field names that are numeric and it's also replacing '.' with and underscore (__).. 

    Is entity framework doing this?

    Friday, August 28, 2015 1:49 PM

Answers

  • User1724605321 posted

    Hi maggiemays ,

    My field names returned are having '.' replaced with underscores,  and numeric field names preceeded with a letter. Why?

    That is because c# doesn't allow a variate involves '.'  and is all numeric .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 1, 2015 3:42 AM

All replies

  • User1724605321 posted

    Hi maggiemays,

    Is entity framework doing this?

    In my understanding ,you want to achieve the same function as the stored procedure in EF? I would suggest you could keep the stored procedure and map the stored procedure in EF:

    https://msdn.microsoft.com/en-us/data/gg699321.aspx .

    http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx .

    If i misunderstand your requirement ,please explain more about that .

    Best Regards,

    Nan Yu

    Monday, August 31, 2015 5:56 AM
  • User632751675 posted

    I was wondering if EF changes the names that are coming from the stored procedure.

    What I'm trying to ask is why are the field names in the result set of the stored procedure different from those in the actual sql server stored proc?

    My field names returned are having '.' replaced with underscores,  and numeric field names preceeded with a letter. Why?

    Monday, August 31, 2015 1:00 PM
  • User1724605321 posted

    Hi maggiemays ,

    My field names returned are having '.' replaced with underscores,  and numeric field names preceeded with a letter. Why?

    That is because c# doesn't allow a variate involves '.'  and is all numeric .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 1, 2015 3:42 AM
  • User632751675 posted

    ok, thanks Nan.

    Tuesday, September 1, 2015 11:29 AM