1

Closed

EFDesigner converter extensions can not work (Remove or obsolete)

description

In triage we decided that we should either remove or obsolete these extensions

The designer is supposed to allow to write an extension to serialize and deserialize edmx model to/from custom formats. To do that you write an extension that implements IModelConversionExtension interface.
When loading a file, if the file extension is not "edmx" we will call OnAfterFileLoaded method on the extension. However there is no way to pass the extended document out. The extension toolkit we shipped has the following guidance on implementing OnAfterFileLoaded method:
    public void OnAfterFileLoaded(ModelConversionExtensionContext context)
    {
        // context.OriginalDocument = Contents of the custom file as a string.
        //                            This is for reference only and cannot be modified.
        //
        // context.CurrentDocument = Contents of the converted file as an XDocument.
        //                           This should be a valid .edmx document.
    }
The problem is that the ModelConversionExtensionContext.CurrentDocument does not have a setter. We do use .CurrentDocument later to populate the transformation context. This leads to another issue. Currently we don't seem to allow doing the conversion without having to do a transformation later.
Finally there seems to be a bug in the code that even if we allowed setting the CurrentDocument and we had a transform the transform would not be invoked anyways. I have not looked at OnBeforeFileSaved method - it can have some issues too.

Issues to fix:
1) Add the setter to the ModelConversionExtensionContext.CurrentDocument
2) Investigate if it is really required to do the transformation after conversion - seems like it can be decoupled.
3) Make sure that it is possible to chain converter and transformer
4) Make sure that OnBeforeFileSaved is usable
  • For OnBeforeFileSaved if a serializer is present we would return context.CurrentDocument, if a converter is present we would return the context.OriginalDocument - investigate if this is correct (especially that we are saving to a custom format that does not have to be Xml/Edmx)
When fixing this bug address TODOs that are inside the method that invokes extensions.

__ When fixing this uncomment (and possibly fix if necessary) tests that are commented out due to this issue__
Closed Dec 12, 2016 at 10:44 PM by RoMiller
EF Team Triage: We are transitioning this project to GitHub (https://github.com/aspnet/EntityFramework6). As part of this transition we are bulk closing a large number of issues in order that our new issue tracker will accurately reflect the work that our team is planning to complete on the EF6.x code base.

Moving forwards, our team will be fixing bugs, implementing small improvements, and accepting community contributions to the EF6.x code base. Larger feature work and innovation will happen in the EF Core code base (https://github.com/aspnet/EntityFramework). Closing a feature request in the EF6.x project does not exclude us implementing the feature in EF Core. In fact, a number of popular feature requests for EF have already been implemented in EF Core (alternate keys, batching in SaveChanges, etc.).

This is a bulk message to indicate that this issue was closed and not ported to the new issue tracker. The reasons for not porting this particular issue to GitHub may include:
  • It was a bug report that does not contain sufficient information for us to be able to reproduce it
  • It was a question, but sufficient time has passed that it's not clear that taking the time to answer it would provide value to the person who asked it
  • It is a feature request that we are realistically not going to implement on the EF6.x code base
    Although this issue was not ported, you may still re-open it in the new issue tracker for our team to reconsider (https://github.com/aspnet/EntityFramework6/issues). We will no longer be monitoring this issue tracker for comments, so please do not reply here.

comments

RoMiller wrote Dec 12, 2013 at 9:41 PM

EF Team Triage: Moving issues with Impact set to Low out of the 6.1.0 release as we only have time to address High and Medium issues in this release. We will re-triage these issues for future releases.

This does not exclude someone outside of the Microsoft EF team from contributing the change/fix in 6.1.0.