当前位置: 首页>>代码示例>>C#>>正文


C# IStructureSchema.GetUniquesTableName方法代码示例

本文整理汇总了C#中IStructureSchema.GetUniquesTableName方法的典型用法代码示例。如果您正苦于以下问题:C# IStructureSchema.GetUniquesTableName方法的具体用法?C# IStructureSchema.GetUniquesTableName怎么用?C# IStructureSchema.GetUniquesTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IStructureSchema的用法示例。


在下文中一共展示了IStructureSchema.GetUniquesTableName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteRecordsMatchingKeyNames

        private void DeleteRecordsMatchingKeyNames(IStructureSchema structureSchema, IEnumerable<string> names)
        {
            var inString = string.Join(",", names.Select(n => "'" + n + "'"));
            var sql = _sqlStrings.GetSql("UniquesSchemaSynchronizer_DeleteRecordsMatchingKeyNames")
                .Inject(structureSchema.GetUniquesTableName(), UniqueStorageSchema.Fields.Name.Name, inString);

            _dbClient.ExecuteNonQuery(CommandType.Text, sql);
        }
开发者ID:darrencauthon,项目名称:SisoDb-Provider,代码行数:8,代码来源:SqlDbUniquesSchemaSynchronizer.cs

示例2: DeleteRecordsMatchingKeyNames

		private void DeleteRecordsMatchingKeyNames(IStructureSchema structureSchema, IEnumerable<string> names, IDbClient dbClient)
        {
            var inString = string.Join(",", names.Select(n => "'" + n + "'"));
            var sql = _sqlStatements.GetSql("UniquesSchemaSynchronizer_DeleteRecordsMatchingKeyNames")
                .Inject(structureSchema.GetUniquesTableName(), UniqueStorageSchema.Fields.UqMemberPath.Name, inString);

            dbClient.ExecuteNonQuery(sql);
        }
开发者ID:ovuncgursoy,项目名称:SisoDb-Provider,代码行数:8,代码来源:SqlDbUniquesSchemaSynchronizer.cs

示例3: GenerateSql

        public string GenerateSql(IStructureSchema structureSchema)
        {
            var sql = structureSchema.IdAccessor.IdType == IdTypes.Guid
                          ? _sqlStrings.GetSql("CreateUniquesGuid")
                          : _sqlStrings.GetSql("CreateUniquesIdentity");

            return sql.Inject(
                structureSchema.GetStructureTableName(),
                structureSchema.GetUniquesTableName());
        }
开发者ID:darrencauthon,项目名称:SisoDb-Provider,代码行数:10,代码来源:SqlDbUniquesSchemaBuilder.cs

示例4: GetExistingDbKeyNames

		private IEnumerable<string> GetExistingDbKeyNames(IStructureSchema structureSchema, IDbClient dbClient)
        {
            var dbColumns = new List<string>();

            dbClient.Read(
                _sqlStatements.GetSql("UniquesSchemaSynchronizer_GetKeyNames").Inject(
                    UniqueStorageSchema.Fields.UqMemberPath.Name,
                    structureSchema.GetUniquesTableName()),
                    dr => dbColumns.Add(dr.GetString(0)));

            return dbColumns;
        }
开发者ID:ovuncgursoy,项目名称:SisoDb-Provider,代码行数:12,代码来源:SqlDbUniquesSchemaSynchronizer.cs

示例5: GetKeyNames

        private IEnumerable<string> GetKeyNames(IStructureSchema structureSchema)
        {
            var dbColumns = new List<string>();

            _dbClient.ExecuteSingleResultReader(CommandType.Text,
                                                _sqlStrings.GetSql("UniquesSchemaSynchronizer_GetKeyNames")
                                                .Inject(
                                                    UniqueStorageSchema.Fields.Name.Name, structureSchema.GetUniquesTableName()),
                                                    dr => dbColumns.Add(dr.GetString(0)));

            return dbColumns;
        }
开发者ID:darrencauthon,项目名称:SisoDb-Provider,代码行数:12,代码来源:SqlDbUniquesSchemaSynchronizer.cs

示例6: Upsert

        public void Upsert(IStructureSchema structureSchema)
        {
            var structuresTableName = structureSchema.GetStructureTableName();
            var indexesTableName = structureSchema.GetIndexesTableName();
            var uniquesTableName = structureSchema.GetUniquesTableName();

            var structuresTableExists = _dbClient.TableExists(structuresTableName);
            var indexesTableExists = _dbClient.TableExists(indexesTableName);
            var uniquesTableExists = _dbClient.TableExists(uniquesTableName);

            if (structuresTableExists && indexesTableExists && uniquesTableExists)
            {
                _indexesDbSchemaSynchronizer.Synchronize(structureSchema);
                _uniquesDbSchemaSynchronizer.Synchronize(structureSchema);
                return;
            }

            var structuresSql = structuresTableExists ? "" : _structuresDbSchemaBuilder.GenerateSql(structureSchema);
            var indexesSql = indexesTableExists ? "" : _indexesDbSchemaBuilder.GenerateSql(structureSchema);
            var uniquesSql = uniquesTableExists ? "" : _uniquesDbSchemaBuilder.GenerateSql(structureSchema);

            using (var cmd = _dbClient.CreateCommand(CommandType.Text, null,
                new QueryParameter("entityHash", structureSchema.Hash),
                new QueryParameter("entityName", structureSchema.Name)))
            {
                if (!structuresTableExists)
                {
                    cmd.CommandText = structuresSql;
                    cmd.ExecuteNonQuery();
                }

                if (!indexesTableExists)
                {
                    cmd.CommandText = indexesSql;
                    cmd.ExecuteNonQuery();
                }
                else
                    _indexesDbSchemaSynchronizer.Synchronize(structureSchema);

                if (!uniquesTableExists)
                {
                    cmd.CommandText = uniquesSql;
                    cmd.ExecuteNonQuery();
                }
                else
                    _uniquesDbSchemaSynchronizer.Synchronize(structureSchema);
            }
        }
开发者ID:darrencauthon,项目名称:SisoDb-Provider,代码行数:48,代码来源:SqlDbSchemaUpserter.cs

示例7: GenerateSql

        public string GenerateSql(IStructureSchema structureSchema)
        {
            var uniquesTableName = structureSchema.GetUniquesTableName();
            var structureTableName = structureSchema.GetStructureTableName();

            if (structureSchema.IdAccessor.IdType == StructureIdTypes.String)
                return _sqlStatements.GetSql("CreateUniquesString").Inject(uniquesTableName, structureTableName);

            if (structureSchema.IdAccessor.IdType == StructureIdTypes.Guid)
                return _sqlStatements.GetSql("CreateUniquesGuid").Inject(uniquesTableName, structureTableName);

            if (structureSchema.IdAccessor.IdType.IsIdentity())
                return _sqlStatements.GetSql("CreateUniquesIdentity").Inject(uniquesTableName, structureTableName);

            throw new SisoDbException(ExceptionMessages.SqlDbUniquesSchemaBuilder_GenerateSql.Inject(structureSchema.IdAccessor.IdType));
        }
开发者ID:BlackMael,项目名称:SisoDb-Provider,代码行数:16,代码来源:SqlDbUniquesSchemaBuilder.cs

示例8: Drop

        public override void Drop(IStructureSchema structureSchema)
        {
			Ensure.That(structureSchema, "structureSchema").IsNotNull();

        	var indexesTableNames = structureSchema.GetIndexesTableNames();

            var sql = SqlStatements.GetSql("DropStructureTables").Inject(
                indexesTableNames.IntegersTableName,
				indexesTableNames.FractalsTableName,
				indexesTableNames.BooleansTableName,
				indexesTableNames.DatesTableName,
				indexesTableNames.GuidsTableName,
				indexesTableNames.StringsTableName,
				indexesTableNames.TextsTableName,
                structureSchema.GetUniquesTableName(),
                structureSchema.GetStructureTableName());

            using (var cmd = CreateCommand(sql, new DacParameter("entityName", structureSchema.Name)))
            {
                cmd.ExecuteNonQuery();
            }
        }
开发者ID:BlackMael,项目名称:SisoDb-Provider,代码行数:22,代码来源:Sql2008DbClient.cs

示例9: Drop

        public override void Drop(IStructureSchema structureSchema)
        {
            Ensure.That(structureSchema, "structureSchema").IsNotNull();

            var modelInfo = GetModelTablesInfo(structureSchema);

            var sqlDropTableFormat = SqlStatements.GetSql("DropTable");

            using (var cmd = CreateCommand(string.Empty, new DacParameter(DbSchemas.Parameters.EntityNameParamPrefix, structureSchema.Name)))
            {
                DropIndexesTables(cmd, modelInfo.Statuses.IndexesTableStatuses, modelInfo.Names.IndexesTableNames);

                if (modelInfo.Statuses.UniquesTableExists)
                {
                    cmd.CommandText = sqlDropTableFormat.Inject(structureSchema.GetUniquesTableName());
                    cmd.ExecuteNonQuery();
                }

                if (modelInfo.Statuses.StructureTableExists)
                {
                    cmd.CommandText = sqlDropTableFormat.Inject(structureSchema.GetStructureTableName());
                    cmd.ExecuteNonQuery();
                }

                cmd.CommandText = SqlStatements.GetSql("DeleteStructureFromSisoDbIdentitiesTable");
                cmd.ExecuteNonQuery();
            }
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:28,代码来源:SqlCe4DbClient.cs

示例10: BulkInsertUniques

        protected virtual void BulkInsertUniques(IStructureSchema structureSchema, IStructureIndex[] uniques)
        {
            if (!uniques.Any())
                return;

            var uniquesStorageSchema = new UniqueStorageSchema(structureSchema, structureSchema.GetUniquesTableName());

            using (var uniquesReader = new UniquesReader(uniquesStorageSchema, uniques))
            {
                using (var bulkInserter = MainDbClient.GetBulkCopy())
                {
                    bulkInserter.DestinationTableName = uniquesReader.StorageSchema.Name;
                    bulkInserter.BatchSize = uniques.Length;

                    var fields = uniquesReader.StorageSchema.GetFieldsOrderedByIndex().Where(f => !f.Equals(StructureStorageSchema.Fields.RowId)).ToArray();
                    foreach (var field in fields)
                        bulkInserter.AddColumnMapping(field.Name, field.Name);

                    bulkInserter.Write(uniquesReader);
                }
            }
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:22,代码来源:DbStructureInserter.cs

示例11: UniqueStorageSchema

 internal UniqueStorageSchema(IStructureSchema structureSchema)
     : base(structureSchema, structureSchema.GetUniquesTableName())
 {
 }
开发者ID:darrencauthon,项目名称:SisoDb-Provider,代码行数:4,代码来源:UniqueStorageSchema.cs


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