• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Mapping.MappingSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.Linq.Mapping.MappingSource的典型用法代码示例。如果您正苦于以下问题:C# MappingSource类的具体用法?C# MappingSource怎么用?C# MappingSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MappingSource类属于System.Data.Linq.Mapping命名空间,在下文中一共展示了MappingSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DataContextFactory

        // 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;
        }
开发者ID:tuansolo,项目名称:CodeBase,代码行数:10,代码来源:DataContextFactory.cs


示例2: DataContextFactory

        /// <summary>
        /// Static constructor.
        /// </summary>
        /// <remarks>
        /// Static initialization of connectionstring and mappingSource.
        /// This significantly increases performance, primarily due to mappingSource cache.
        /// </remarks>        
        static DataContextFactory()
        {
            string connectionStringName = ConfigurationManager.AppSettings.Get("ConnectionStringName");
            _connectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;

            DataContext context = new ActionDataContext(_connectionString);
            _mappingSource = context.Mapping.MappingSource;
        }
开发者ID:ronymaychan,项目名称:demos,代码行数:15,代码来源:DataContextFactory.cs


示例3: ExtensibleDataContext

        public ExtensibleDataContext(object connection, MappingSource mapping)
            : base("", mapping)
        {
            FieldInfo providerField = typeof(System.Data.Linq.DataContext).GetField("provider", BindingFlags.Instance | BindingFlags.NonPublic);

            object proxy = new ProviderProxy(this).GetTransparentProxy();

            providerField.SetValue(this, proxy);

            this.Initialize(connection);
        }
开发者ID:Rclemens,项目名称:Stibkamp,代码行数:11,代码来源:ExtensibleDataContext.cs


示例4: AttributedMetaModel

        internal AttributedMetaModel(MappingSource mappingSource, Type contextType) {
            this.mappingSource = mappingSource;
            this.contextType = contextType;
            this.metaTypes = new Dictionary<Type, MetaType>();
            this.metaTables = new Dictionary<Type, MetaTable>();
            this.metaFunctions = new Dictionary<MetaPosition, MetaFunction>();

            // Provider type
            ProviderAttribute[] attrs = (ProviderAttribute[])this.contextType.GetCustomAttributes(typeof(ProviderAttribute), true);
            if (attrs != null && attrs.Length == 1) { // Provider attribute is !AllowMultiple
                this.providerType = attrs[0].Type;
            } else {
                this.providerType = typeof(SqlProvider);
            }

            // Database name 
            DatabaseAttribute[] das = (DatabaseAttribute[])this.contextType.GetCustomAttributes(typeof(DatabaseAttribute), false);
            this.dbName = (das != null && das.Length > 0) ? das[0].Name : this.contextType.Name;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:19,代码来源:AttributedMetaModel.cs


示例5: MappedMetaModel

 [ResourceConsumption(ResourceScope.Assembly | ResourceScope.Machine)] // FindType method call.
 internal MappedMetaModel(MappingSource mappingSource, Type contextType, DatabaseMapping mapping) {
     this.mappingSource = mappingSource;
     this.contextType = contextType;
     this.mapping = mapping;
     this.modules = new HashSet<Module>();
     this.modules.Add(this.contextType.Module);
     this.metaTypes = new Dictionary<Type, MetaType>();
     this.metaTables = new Dictionary<Type, MetaTable>();
     this.types = new Dictionary<string, Type>();
     // Provider type
     if (this.providerType == null && !String.IsNullOrEmpty(this.mapping.Provider)) {
         this.providerType = this.FindType(this.mapping.Provider, typeof(SqlProvider).Namespace);
         if (this.providerType == null) {
             throw Error.ProviderTypeNotFound(this.mapping.Provider);
         }
     }
     else if (this.providerType == null) {
         this.providerType = typeof(SqlProvider);
     }
     this.Init();
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:22,代码来源:MappedMetaModel.cs


示例6: MappedMetaModel

        [ResourceConsumption(ResourceScope.Assembly | ResourceScope.Machine)] // FindType method call.
        internal MappedMetaModel(MappingSource mappingSource, Type contextType, DatabaseMapping mapping) {
            this.mappingSource = mappingSource;
            this.contextType = contextType;
            this.mapping = mapping;
            this.modules = new HashSet<Module>();
            this.modules.Add(this.contextType.Module);
            this.metaTypes = new Dictionary<Type, MetaType>();
            this.metaTables = new Dictionary<Type, MetaTable>();
            this.types = new Dictionary<string, Type>();
#warning [FB] REFACTOR SQL Server specific. Requires change to have its provider type injected instead of it tries to discover it on its own using sql server's specific namespace.
            // Provider type
            if (this.providerType == null && !String.IsNullOrEmpty(this.mapping.Provider)) {
                this.providerType = this.FindType(this.mapping.Provider, typeof(System.Data.Linq.DbEngines.SqlServer.SqlProvider).Namespace);
                if (this.providerType == null) {
                    throw Error.ProviderTypeNotFound(this.mapping.Provider);
                }
            }
            else if (this.providerType == null) {
                this.providerType = typeof(System.Data.Linq.DbEngines.SqlServer.SqlProvider);
            }
            this.Init();
        }
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:23,代码来源:MappedMetaModel.cs


示例7: CustomLibraryDataContext

 public CustomLibraryDataContext(IDbConnection connection, MappingSource mappingSource)
     : base(connection, mappingSource)
 {
 }
开发者ID:WilliamRobertMontgomery,项目名称:asp-dot-net-training-project,代码行数:4,代码来源:CustomLibraryDataContext.cs


示例8: DB

 public DB(IDbConnection connection, MappingSource mappingSource) :
     base(connection, mappingSource)
 {
     this.OnCreated();
 }
开发者ID:ddfczm,项目名称:Project-Dollhouse,代码行数:5,代码来源:CityDataModelGenerated.cs


示例9: AnnotationDataContext

		public AnnotationDataContext(System.Data.IDbConnection connection, MappingSource mappingSource) :
			base(connection, mappingSource)
		{
			OnCreated();
		}
开发者ID:abordt,项目名称:Viking,代码行数:5,代码来源:Annotation.generated.cs


示例10: NorthwindDataContext

 public NorthwindDataContext( IDbConnection connection, MappingSource mappingSource )
     :
       base( connection, mappingSource )
 {
     OnCreated();
 }
开发者ID:richiejp,项目名称:NHaml,代码行数:6,代码来源:Northwind.cs


示例11: DataContextBase

 public DataContextBase(string connection, MappingSource mappingSource)
     : base(connection, mappingSource)
 {
     this.DataBasePath = FilePath(connection);
 }
开发者ID:zhangyinglong,项目名称:zyl_04401,代码行数:5,代码来源:DataContextBase.cs


示例12: DataClasses1DataContext

		public DataClasses1DataContext(string connection, MappingSource mappingSource) :
			base(connection, mappingSource)
		{
			OnCreated();
		}
开发者ID:rupeshkumar399,项目名称:seemapcell,代码行数:5,代码来源:DataClasses1.generated.cs


示例13: BaseDataContext

 protected BaseDataContext(IDbConnection connection, MappingSource mapping)
     : base(connection, mapping)
 {
 }
开发者ID:onikonychev,项目名称:MerchantBeat,代码行数:4,代码来源:BaseDataContext.cs


示例14: AttributedMetaModel

 public AttributedMetaModel(Type dataContextType, MappingSource mappingSource)
 {
     contextType = dataContextType;
     this.mappingSource = mappingSource;
     Load();
 }
开发者ID:TheRealDuckboy,项目名称:mono-soc-2008,代码行数:6,代码来源:AttributedMetaModel.cs


示例15: DataImageDataContext

		public DataImageDataContext(IDbConnection connection, MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
开发者ID:ideayapai,项目名称:docviewer,代码行数:5,代码来源:DataImage.designer.cs


示例16: DocviewerDataContext

		public DocviewerDataContext(string connection, MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
开发者ID:ideayapai,项目名称:doc,代码行数:5,代码来源:DocViewer.designer.cs


示例17: DrivingSCool

		public DrivingSCool(string connection, MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			this.OnCreated();
		}
开发者ID:pacholik,项目名称:driving_scools_server,代码行数:5,代码来源:Northwind.cs


示例18: ContextFactory

 static ContextFactory()
 {
     _tobserviceMappingSrc = CreateTOBMappingSource();
 }
开发者ID:ankitb,项目名称:TweetOBox,代码行数:4,代码来源:ContextFactory.cs


示例19: PPDataContext

		public PPDataContext(IDbConnection connection, MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			this.OnCreated();
		}
开发者ID:minrogi,项目名称:PLMPackLib,代码行数:5,代码来源:Pic.DAL.SQLite.DataContext.designer.cs


示例20: ExtensionDataContext

 /// <summary>
 /// Initializes a new instance of the System.Data.Linq.DataContext class by referencing a connection and a mapping source.
 /// </summary>
 /// <param name="connection">The connection used by the .NET Framework.</param>
 /// <param name="mapping">The System.Data.Linq.Mapping.MappingSource.</param>
 public ExtensionDataContext(IDbConnection connection, MappingSource mapping)
     : base(connection, mapping)
 {
 }
开发者ID:TatumAndBell,项目名称:RapidWebDev-Enterprise-CMS,代码行数:9,代码来源:ExtensionDataContext.cs



注:本文中的System.Data.Linq.Mapping.MappingSource类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Mapping.MetaType类代码示例发布时间:2022-05-26
下一篇:
C# EntityClient.EntityConnectionStringBuilder类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap