Created
February 11, 2014 12:02
-
-
Save FransBouma/8933631 to your computer and use it in GitHub Desktop.
How silly the Telerik DataAccess wizard is.
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
// 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