Export (0) Print
Expand All

IModelConversionExtension.OnBeforeFileSaved Method

Defines custom functionality for converting an .edmx file to a file with a custom format before the file is saved.

Namespace:  Microsoft.Data.Entity.Design.Extensibility
Assembly:  Microsoft.Data.Entity.Design.Extensibility (in Microsoft.Data.Entity.Design.Extensibility.dll)

Sub OnBeforeFileSaved ( _
	context As ModelConversionExtensionContext _
Dim instance As IModelConversionExtension
Dim context As ModelConversionExtensionContext



Type: Microsoft.Data.Entity.Design.Extensibility.ModelConversionExtensionContext
Provides file and Visual Studio project information.

In a Visual Studio extension, the OnBeforeFileSaved method is used to extend the functionality of the Entity Data Model Designer (Entity Designer). Specifically, the OnBeforeFileSaved method converts an .edmx file to a custom format before the file is saved. The Microsoft.Data.Entity.Design.Extensibility.ModelFileExtensionAttribute is used to annotate classes that implement the IModelConversionExtension interface. The Microsoft.Data.Entity.Design.Extensibility.ModelFileExtensionAttribute constructor accepts a string parameter that specifies the file extension for custom files that can be loaded and saved by the Entity Designer.


When building a Visual Studio extension that also implements the IModelTransformExtension.OnBeforeModelSaved method, the OnBeforeFileSaved method will be called after the IModelTransformExtension.OnBeforeModelSaved method.

For more information about extending the functionality of the ADO.NET Entity Data Model Tools, see Extending the Entity Data Model Tools and ADO.NET Entity Data Model Designer Extension Starter Kit.

© 2014 Microsoft