Created
June 26, 2013 01:27
-
-
Save raghuramn/5864013 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEdmModel GetEdmModel(this DbContext context) | |
{ | |
using (MemoryStream stream = new MemoryStream()) | |
{ | |
using (XmlWriter writer = XmlWriter.Create(stream)) | |
{ | |
EdmxWriter.WriteEdmx(context, writer); | |
writer.Close(); | |
stream.Seek(0, SeekOrigin.Begin); | |
using (XmlReader reader = XmlReader.Create(stream)) | |
{ | |
return Microsoft.Data.Edm.Csdl.EdmxReader.Parse(reader); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@raghuramn, Could we get a new sample of this that works with the latest bits on MyGet (EdmLib 6.4)? I arrived here via this work item.