Skip to content

Instantly share code, notes, and snippets.

@adjames
Created August 27, 2012 20:03
Show Gist options
  • Save adjames/3491809 to your computer and use it in GitHub Desktop.
Save adjames/3491809 to your computer and use it in GitHub Desktop.
EdmLib load an IEdmModel
static IEdmModel GetEdmModel(string url)
{
IEdmModel model = null;
IEnumerable<EdmError> errors = null;
using (var reader = XmlTextReader.Create(url))
{
if (EdmxReader.TryParse(reader, out model, out errors))
{
return model;
}
throw new Exception(errors.First().ErrorMessage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment