本文整理汇总了C#中ObjectIdentifier.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectIdentifier.GetName方法的具体用法?C# ObjectIdentifier.GetName怎么用?C# ObjectIdentifier.GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectIdentifier
的用法示例。
在下文中一共展示了ObjectIdentifier.GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLiteralType
public static LiteralType GetLiteralType(ObjectIdentifier name)
{
switch (name.GetName())
{
case "bigint":
case "smallint":
case "tinyint":
case "int":
case "bit":
return LiteralType.Integer;
case "numeric":
case "decimal":
case "float":
case "real":
return LiteralType.Numeric;
case "money":
case "smallmoney":
return LiteralType.Money;
case "date":
case "datetimeoffset":
case "datetime2":
case "smalldatetime":
case "datetime":
case "time":
case "char":
case "varchar":
case "text":
case "nchar":
case "nvarchar":
case "ntext":
case "timestamp":
case "uniqueidentifier":
case "sql_variant":
case "xml":
return LiteralType.String;
case "binary":
case "varbinary":
case "image":
return LiteralType.Binary;
}
return LiteralType.String;
}
示例2: IsNText
public static bool IsNText(ObjectIdentifier name)
{
switch (name.GetName())
{
case "nchar":
case "nvarchar":
case "ntext":
case "xml":
return true;
}
return false;
}
示例3: CreateFakeTableDefinition
private void CreateFakeTableDefinition(ObjectIdentifier table)
{
var fakeTable = new ExecuteStatement();
fakeTable.ExecuteSpecification = new ExecuteSpecification();
var procedureReference = new ProcedureReference();
procedureReference.Name = new SchemaObjectName();
procedureReference.Name.Identifiers.Add("tSQLt".ToIdentifier());
procedureReference.Name.Identifiers.Add("FakeTable".ToIdentifier());
var entity = new ExecutableProcedureReference();
entity.ProcedureReference = new ProcedureReferenceName();
entity.ProcedureReference.ProcedureReference = procedureReference;
entity.Parameters.Add(
ParametersHelper.CreateStoredProcedureParameter(string.Format("{0}", table.GetSchema())));
entity.Parameters.Add(
ParametersHelper.CreateStoredProcedureParameter(string.Format("{0}", table.GetName())));
fakeTable.ExecuteSpecification.ExecutableEntity = entity;
_testProcedure.StatementList.Statements.Add(fakeTable);
}