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


C# ResourceType.Equals方法代码示例

本文整理汇总了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;
        }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:13,代码来源:ResourceMap.cs

示例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)));
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:58,代码来源:NonClrWorkspace.cs


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