本文整理汇总了C#中ResourceType.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceType.Equals方法的具体用法?C# ResourceType.Equals怎么用?C# ResourceType.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceType
的用法示例。
在下文中一共展示了ResourceType.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsResourceMapType
public static bool IsResourceMapType(ResourceType type)
{
if (type.Equals(ResourceType.PROCESS_AGENT.ToString()) ||
type.Equals(ResourceType.CLIENT.ToString()) ||
type.Equals(ResourceType.RESOURCE_MAPPING.ToString()) ||
type.Equals(ResourceType.STRING.ToString()) ||
type.Equals(ResourceType.TICKET_TYPE.ToString()) ||
type.Equals(ResourceType.GROUP.ToString()) ||
type.Equals(ResourceType.RESOURCE_TYPE.ToString()))
return true;
return false;
}
示例2: GetAllExistingKeysOfType
public override KeyExpressions GetAllExistingKeysOfType(ResourceContainer resourceContainer, ResourceType resourceType)
{
if (!this.DataGenerator.Done)
{
return this.DataGenerator.GetAllGeneratedKeys(resourceContainer, resourceType);
}
bool rightsChanged = false;
EntitySetRights oldRights = this.DataService.ConfigSettings.GetEntitySetAccessRule(resourceContainer.Name);
if ((EntitySetRights.ReadMultiple & oldRights) == 0)
{
rightsChanged = true;
this.DataService.ConfigSettings.SetEntitySetAccessRule(resourceContainer.Name, EntitySetRights.All);
}
bool resourceTypeUnspecified = resourceType == null;
if (resourceTypeUnspecified)
{
resourceType = resourceContainer.BaseType;
}
ExpNode query = Query.From(Exp.Variable(resourceContainer)).Where(Exp.IsOf(null, resourceType));
if (Versioning.Server.SupportsV2Features && !this.Settings.HasExpandProvider)
{
query = ((QueryNode)query).New(resourceType.Properties.Where(p => p.PrimaryKey != null || p.Facets.ConcurrencyModeFixed).Select(p => p.Property()).ToArray());
}
else
{
query = ((QueryNode)query).Select();
}
AstoriaRequest request = this.CreateRequest(query);
AstoriaResponse response = request.GetResponse();
// When the response is 404 this means no keys were found so return empty
if(response.ActualStatusCode == HttpStatusCode.NotFound)
{
return new KeyExpressions();
}
// normal verification doesn't work here safely due to ETags and No-Content responses
if (response.ActualStatusCode != HttpStatusCode.OK && response.ActualStatusCode != HttpStatusCode.NoContent)
ResponseVerification.LogFailure(response, new TestFailedException("Unexpected status code"));
if (rightsChanged)
this.DataService.ConfigSettings.SetEntitySetAccessRule(resourceContainer.Name, oldRights);
KeyExpressions allKeys = GetKeyExpressionsFromPayload(resourceContainer, response);
if (resourceTypeUnspecified)
{
return allKeys;
}
return new KeyExpressions(allKeys.Where(key => resourceType.Equals(key.ResourceType)));
}