Skip to content

Instantly share code, notes, and snippets.

@FransBouma
Created February 11, 2014 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FransBouma/8933631 to your computer and use it in GitHub Desktop.
Save FransBouma/8933631 to your computer and use it in GitHub Desktop.
How silly the Telerik DataAccess wizard is.
// in the generated massive file for fluent mappings.
public partial class FluentModel : OpenAccessContext, IFluentModelUnitOfWork
{
private static string connectionStringName = @"AdventureWorksConnection";
private static BackendConfiguration backend = GetBackendConfiguration();
// The line below is generated by the Telerik 'wizard' (which should actually be called 'dumbass') and causes the code to recreate the mapping model
// every time.
//private static MetadataSource metadataSource = new FluentModelMetadataSource();
// using this line however fixes it (ref: http://docs.telerik.com/data-access/developers-guide/code-only-mapping/getting-started/fluent-mapping-creating-custom-context )
// and makes the individual fetches at least normal, as they otherwise would be massively slow. It does have the disadvantage that the model can't
// be changed at runtime, but in that case, one would probably use a separate model instance for that situation anyway.
private static MetadataContainer metadataSource = new FluentModelMetadataSource().GetModel();
// rest stays the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment