none
The Entity Framework(EDMX) RRS feed

  • Question

  • Hi,

    I am having two foreign keys in the table, those are PrinterID and TeamMemberID. Before TeamMemberID was NULL now I made it as NOT NULL column in database as well as EDMX file.  But in the EDMX class file generation for that particular table the following line of code is dropped for PrinterID column when I compared with the previous version.

    Here I am stunned since I didn’t change or touch the PrinterID column but still the following line of code is dropping. Please anyone suggest me whether this is the expected behavior, if it expected then please explain me why? thanks in Advance!!

                    try

                    {

                        _settingFK = true;

                    finally

                    {

                        _settingFK = false;

                    }

    Thanks,

    Adarsh Shetty

    Sunday, February 23, 2014 10:34 PM

All replies

  • Hello,

    >> But in the EDMX class file generation for that particular table the following line of code is dropped for PrinterID column when I compared with the previous version.

    As far as I know, it would not do any change with the code if we set a column nullable feature to be true or false.

    And in my generated codes, I do not have such a line whether I use the context inherited from DbContext or ObjectContext:

    _settingFK = true;

    Which Entity Framework version are you using? What does your context object inherit from, DbContext or ObjectContext? Could you please share the class which the above line locate?

    More Information regarding EF:

    http://msdn.microsoft.com/en-us/data/ef.aspx

    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.


    Monday, February 24, 2014 3:32 AM
    Moderator