本文整理汇总了C#中DataSpace类的典型用法代码示例。如果您正苦于以下问题:C# DataSpace类的具体用法?C# DataSpace怎么用?C# DataSpace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataSpace类属于命名空间,在下文中一共展示了DataSpace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DbDeleteCommandTree
internal DbDeleteCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target, DbExpression predicate)
: base(metadata, dataSpace, target)
{
EntityUtil.CheckArgumentNull(predicate, "predicate");
this._predicate = predicate;
}
示例2: GetMap
/// <summary>
/// Search for a Mapping metadata with the specified type key.
/// </summary>
/// <param name="identity">identity of the type</param>
/// <param name="typeSpace">The dataspace that the type for which map needs to be returned belongs to</param>
/// <param name="ignoreCase">true for case-insensitive lookup</param>
/// <exception cref="ArgumentException"> Thrown if mapping space is not valid</exception>
internal virtual Map GetMap(string identity, DataSpace typeSpace, bool ignoreCase)
{
Contract.Requires(identity != null);
//will only be implemented by Mapping Item Collections
throw Error.NotSupported();
}
示例3: DbModificationCommandTree
internal DbModificationCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target)
: base(metadata, dataSpace)
{
Contract.Requires(target != null);
_target = target;
}
示例4: GetSchemaXsd
/// <summary>
/// Returns the stream of the XSD corresponding to the frameworkVersion, and dataSpace passed in.
/// </summary>
/// <param name="entityFrameworkVersion">The version of the EntityFramework that you want the Schema XSD for.</param>
/// <param name="dataSpace">The data space of the schem XSD that you want.</param>
/// <returns>Stream version of the XSD</returns>
public static Stream GetSchemaXsd(Version entityFrameworkVersion, DataSpace dataSpace)
{
EDesignUtil.CheckTargetEntityFrameworkVersionArgument(entityFrameworkVersion, "entityFrameworkVersion");
string resourceName = null;
switch(dataSpace)
{
case DataSpace.CSpace:
resourceName = GetEdmSchemaXsdResourceName(entityFrameworkVersion);
break;
case DataSpace.CSSpace:
resourceName = GetMappingSchemaXsdResourceName(entityFrameworkVersion);
break;
case DataSpace.SSpace:
resourceName = GetStoreSchemaXsdResourceName(entityFrameworkVersion);
break;
default:
throw EDesignUtil.Argument("dataSpace");
}
Debug.Assert(!string.IsNullOrEmpty(resourceName), "Did you forget to map something new?");
Assembly dataEntity = typeof(EdmItemCollection).Assembly;
return dataEntity.GetManifestResourceStream(resourceName);
}
示例5: GetMap
// <summary>
// Search for a Mapping metadata with the specified type key.
// </summary>
// <param name="identity"> identity of the type </param>
// <param name="typeSpace"> The dataspace that the type for which map needs to be returned belongs to </param>
// <param name="ignoreCase"> true for case-insensitive lookup </param>
// <exception cref="ArgumentException">Thrown if mapping space is not valid</exception>
internal virtual MappingBase GetMap(string identity, DataSpace typeSpace, bool ignoreCase)
{
DebugCheck.NotNull(identity);
//will only be implemented by Mapping Item Collections
throw Error.NotSupported();
}
示例6: DbCommandTree
/// <summary>
/// Initializes a new command tree with a given metadata workspace.
/// </summary>
/// <param name="metadata">The metadata workspace against which the command tree should operate.</param>
/// <param name="dataSpace">The logical 'space' that metadata in the expressions used in this command tree must belong to.</param>
internal DbCommandTree(MetadataWorkspace metadata, DataSpace dataSpace)
{
// Ensure the metadata workspace is non-null
EntityUtil.CheckArgumentNull(metadata, "metadata");
// Ensure that the data space value is valid
if (!DbCommandTree.IsValidDataSpace(dataSpace))
{
throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_CommandTree_InvalidDataSpace, "dataSpace");
}
//
// Create the tree's metadata workspace and initalize commonly used types.
//
MetadataWorkspace effectiveMetadata = new MetadataWorkspace();
//While EdmItemCollection and StorageitemCollections are required
//ObjectItemCollection may or may not be registered on the workspace yet.
//So register the ObjectItemCollection if it exists.
ItemCollection objectItemCollection;
if (metadata.TryGetItemCollection(DataSpace.OSpace, out objectItemCollection))
{
effectiveMetadata.RegisterItemCollection(objectItemCollection);
}
effectiveMetadata.RegisterItemCollection(metadata.GetItemCollection(DataSpace.CSpace));
effectiveMetadata.RegisterItemCollection(metadata.GetItemCollection(DataSpace.CSSpace));
effectiveMetadata.RegisterItemCollection(metadata.GetItemCollection(DataSpace.SSpace));
this._metadata = effectiveMetadata;
this._dataSpace = dataSpace;
}
示例7: DbModificationCommandTree
internal DbModificationCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target)
: base(metadata, dataSpace)
{
DebugCheck.NotNull(target);
_target = target;
}
示例8: CollectFilePermissionPaths
public override void CollectFilePermissionPaths(List<string> paths, DataSpace spaceToGet)
{
foreach (var loader in _children)
{
loader.CollectFilePermissionPaths(paths, spaceToGet);
}
}
示例9: DbModificationCommandTree
internal DbModificationCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target)
: base(metadata, dataSpace)
{
EntityUtil.CheckArgumentNull(target, "target");
this._target = target;
}
示例10: RelationshipType
/// <summary>
/// Initializes a new instance of relationship type
/// </summary>
/// <param name="name">name of the relationship type</param>
/// <param name="namespaceName">namespace of the relationship type</param>
/// <param name="version">version of the relationship type</param>
/// <param name="dataSpace">dataSpace in which this edmtype belongs to</param>
/// <exception cref="System.ArgumentNullException">Thrown if either name, namespace or version arguments are null</exception>
internal RelationshipType(
string name,
string namespaceName,
DataSpace dataSpace)
: base(name, namespaceName, dataSpace)
{
}
示例11: DbDeleteCommandTree
internal DbDeleteCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target, DbExpression predicate)
: base(metadata, dataSpace, target)
{
Contract.Requires(predicate != null);
_predicate = predicate;
}
示例12: DbDeleteCommandTree
/// <summary>
/// Initializes a new instance of the <see cref="DbDeleteCommandTree"/> class.
/// </summary>
/// <param name="metadata">The model this command will operate on.</param>
/// <param name="dataSpace">The data space.</param>
/// <param name="target">The target table for the data manipulation language (DML) operation.</param>
/// <param name="predicate">A predicate used to determine which members of the target collection should be deleted.</param>
public DbDeleteCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target, DbExpression predicate)
: base(metadata, dataSpace, target)
{
DebugCheck.NotNull(predicate);
_predicate = predicate;
}
示例13: DbCommandTree
/// <summary>
/// Initializes a new command tree with a given metadata workspace.
/// </summary>
/// <param name="metadata">The metadata workspace against which the command tree should operate.</param>
/// <param name="dataSpace">The logical 'space' that metadata in the expressions used in this command tree must belong to.</param>
internal DbCommandTree(MetadataWorkspace metadata, DataSpace dataSpace)
{
// Ensure the metadata workspace is non-null
//Contract.Requires(metadata != null);
// Ensure that the data space value is valid
if (!IsValidDataSpace(dataSpace))
{
throw new ArgumentException(Strings.Cqt_CommandTree_InvalidDataSpace, "dataSpace");
}
//
// Create the tree's metadata workspace and initalize commonly used types.
//
var effectiveMetadata = new MetadataWorkspace();
//While EdmItemCollection and StorageitemCollections are required
//ObjectItemCollection may or may not be registered on the workspace yet.
//So register the ObjectItemCollection if it exists.
ItemCollection objectItemCollection;
if (metadata.TryGetItemCollection(DataSpace.OSpace, out objectItemCollection))
{
effectiveMetadata.RegisterItemCollection(objectItemCollection);
}
effectiveMetadata.RegisterItemCollection(metadata.GetItemCollection(DataSpace.CSpace));
effectiveMetadata.RegisterItemCollection(metadata.GetItemCollection(DataSpace.CSSpace));
effectiveMetadata.RegisterItemCollection(metadata.GetItemCollection(DataSpace.SSpace));
_metadata = effectiveMetadata;
_dataSpace = dataSpace;
}
示例14: Perspective
/// <summary>
/// Creates a new instance of perspective class so that query can work
/// ignorant of all spaces
/// </summary>
/// <param name="metadataWorkspace">runtime metadata container</param>
/// <param name="targetDataspace">target dataspace for the perspective</param>
internal Perspective(MetadataWorkspace metadataWorkspace,
DataSpace targetDataspace)
{
EntityUtil.CheckArgumentNull(metadataWorkspace, "metadataWorkspace");
m_metadataWorkspace = metadataWorkspace;
m_targetDataspace = targetDataspace;
}
示例15: EdmModel
public EdmModel(EntityContainer entityContainer, double version = XmlConstants.SchemaVersionLatest)
{
Check.NotNull(entityContainer, "entityContainer");
_dataSpace = entityContainer.DataSpace;
_containers.Add(entityContainer);
SchemaVersion = version;
}