本文整理汇总了C#中ItemCollection.AddInternal方法的典型用法代码示例。如果您正苦于以下问题:C# ItemCollection.AddInternal方法的具体用法?C# ItemCollection.AddInternal怎么用?C# ItemCollection.AddInternal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemCollection
的用法示例。
在下文中一共展示了ItemCollection.AddInternal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadItems
internal static List<EdmSchemaError> LoadItems(DbProviderManifest manifest, IList<Schema> somSchemas,
ItemCollection itemCollection)
{
List<EdmSchemaError> errors = new List<EdmSchemaError>();
// Convert the schema, if model schema, then we use the EDM provider manifest, otherwise use the
// store provider manifest
IEnumerable<GlobalItem> newGlobalItems = LoadSomSchema(somSchemas, manifest, itemCollection);
List<String> tempCTypeFunctionIdentity = new List<string>();
// No errors, so go ahead and add the types and make them readonly
foreach (GlobalItem globalItem in newGlobalItems)
{
// If multiple function parameter and return types expressed in SSpace map to the same
// CSpace type (e.g., SqlServer.decimal and SqlServer.numeric both map to Edm.Decimal),
// we need to guard against attempts to insert duplicate functions into the collection.
//
if (globalItem.BuiltInTypeKind == BuiltInTypeKind.EdmFunction && globalItem.DataSpace == DataSpace.SSpace)
{
EdmFunction function = (EdmFunction)globalItem;
StringBuilder sb = new StringBuilder();
EdmFunction.BuildIdentity(
sb,
function.FullName,
function.Parameters,
// convert function parameters to C-side types
(param) => MetadataHelper.ConvertStoreTypeUsageToEdmTypeUsage(param.TypeUsage),
(param) => param.Mode);
string cTypeFunctionIdentity = sb.ToString();
// Validate identity
if (tempCTypeFunctionIdentity.Contains(cTypeFunctionIdentity))
{
errors.Add(
new EdmSchemaError(
Strings.DuplicatedFunctionoverloads(function.FullName, cTypeFunctionIdentity.Substring(function.FullName.Length)).Trim()/*parameters*/,
(int)ErrorCode.DuplicatedFunctionoverloads,
EdmSchemaErrorSeverity.Error));
continue;
}
tempCTypeFunctionIdentity.Add(cTypeFunctionIdentity);
}
globalItem.SetReadOnly();
itemCollection.AddInternal(globalItem);
}
return errors;
}