Ejemplo n.º 1
0
        // static initialization of connectionstring and mappingSource.
        // This significantly increases performance, primarily due to mappingSource cache.

        static DataContextFactory()
        {
            connectionString = ConfigurationManager.ConnectionStrings["Action"].ConnectionString;

            var context = new ActionDataContext(connectionString);
            mappingSource = context.Mapping.MappingSource;
        }
        // static initialization of connectionstring and mappingSource.
        // This significantly increases performance, primarily due to mappingSource cache.

        static DataContextFactory()
        {
            connectionString = ConfigurationManager.ConnectionStrings["Action"].ConnectionString;

            var context = new ActionDataContext(connectionString);

            mappingSource = context.Mapping.MappingSource;
        }