locked
How do I access the resource-file data for the MSL mapping file/XML? RRS feed

  • Question

  • WHAT I HAVE:

    Visual Basic 2019, .NET 4+, WinForms, Entity Framework

    MY PROBLEM:

    I've found that it's often convenient to be able to programmatically convert between the entity/property names of the conceptual EF model and the corresponding table/field names of the store model. If one wants to do SQL for, say, creating additional indexes on an entity's table, if the EF and/or store model is very complex, or if one is frequently changing the relationship between the 2 models, then having a tool to discover the mapping between the conceptual and the store is very useful, as EF doesn't directly expose the MSL mapping info in the EF object heirarchy!

    The good news is that I've created a tool that, given an entity name and a property-expression name, returns the corresponding table and field names, by parsing the XML of the MSL file. The bad news is that it depends on the model opting to copy the MSL, CSDL, and SSDL files to the Output Directory. What if the EF model doesn't do this? Then one has to find the XML data in the resource files!

    I'd like a function that, given the "res://model.csdl|res://model.ssdl|res://model.msl" info, returns the file, or the XML data, with the MSL (or, for that matter, the CSDL or SSDL) information.

    Please give me someting ASAP, and in VB!


    Robert Gustafson




    Monday, April 6, 2020 3:36 AM

All replies

  • Hi RobertGustafson,
    I viewed your description, it is recommended to report a problem on the Developer Community and you can get more professional answer.
    Thank you for your understanding.
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, April 7, 2020 8:50 AM
  • WHAT I HAVE:

    Visual Basic 2019, .NET 4+, WinForms, Entity Framework

    MY PROBLEM:

    I've found that it's often convenient to be able to programmatically convert between the entity/property names of the conceptual EF model and the corresponding table/field names of the store model. If one wants to do SQL for, say, creating additional indexes on an entity's table, if the EF and/or store model is very complex, or if one is frequently changing the relationship between the 2 models, then having a tool to discover the mapping between the conceptual and the store is very useful, as EF doesn't directly expose the MSL mapping info in the EF object heirarchy!

    The good news is that I've created a tool that, given an entity name and a property-expression name, returns the corresponding table and field names, by parsing the XML of the MSL file. The bad news is that it depends on the model opting to copy the MSL, CSDL, and SSDL files to the Output Directory. What if the EF model doesn't do this? Then one has to find the XML data in the resource files!

    I'd like a function that, given the "res://model.csdl|res://model.ssdl|res://model.msl" info, returns the file, or the XML data, with the MSL (or, for that matter, the CSDL or SSDL) information.

    Please give me someting ASAP, and in VB!


    Robert Gustafson




    Robert Gustafson

    Wednesday, April 8, 2020 2:05 AM
  • When I click your "Developer Community" link, I get directed back here.

    Robert Gustafson

    Wednesday, April 8, 2020 2:07 AM
  • Hi RobertGustafson,
    Sorry for my mistake, I have corrected it.
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 8, 2020 2:14 AM
  • The solution offered in Development Community only works for .NET 4.7, and my app is targeted for .NET 4.6.1, since some of its other components don't work quite right in the more recent platform. I need a solution for pre-.NET 4.7, and in VB, that can (at run-time) get the XML in a metadata file when it's embedded in the assembly-resource.

    Robert Gustafson

    Saturday, August 15, 2020 4:00 AM