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


C# Collection.Single方法代码示例

本文整理汇总了C#中Collection.Single方法的典型用法代码示例。如果您正苦于以下问题:C# Collection.Single方法的具体用法?C# Collection.Single怎么用?C# Collection.Single使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Collection的用法示例。


在下文中一共展示了Collection.Single方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveAttribute

        private void RemoveAttribute( Collection<CustomAttribute> customAttributes )
        {
            var extattr = customAttributes.Single( x => x.AttributeType == _attributeToStrip );

            customAttributes.Remove( extattr );
        }
开发者ID:InishTech,项目名称:ExtensionAttributeStripper,代码行数:6,代码来源:AttributeStripper.cs

示例2: VerifyCreatePremiumDb

        private static Services.Server.Database[] VerifyCreatePremiumDb(Collection<PSObject> newPremiumP1DatabaseResult, string databaseName, string serviceObjectiveId)
        {
            Services.Server.Database[] databases = new Services.Server.Database[] { newPremiumP1DatabaseResult.Single().BaseObject as Services.Server.Database };
            Assert.AreEqual(1, databases.Length, "Expecting one database");
            Assert.IsNotNull(databases[0], "Expecting a Database object.");
            Assert.AreEqual(databases[0].Name, databaseName, string.Format("Expecting Database Name:{0}, actual is:{1}", databaseName, databases[0].Name));

             Assert.AreEqual("Premium", databases[0].Edition);
             Assert.AreEqual(databases[0].AssignedServiceObjectiveId, Guid.Parse(serviceObjectiveId), string.Format("Expecting Database Edition:{0}, actual is:{1}", serviceObjectiveId, databases[0].AssignedServiceObjectiveId));

            Assert.AreEqual("SQL_Latin1_General_CP1_CI_AS", databases[0].CollationName);
            return databases;
        }
开发者ID:hovsepm,项目名称:azure-sdk-tools,代码行数:13,代码来源:AzureSqlDatabaseCertAuthTests.cs

示例3: VerifyCreatePremiumDb

 private static Database[] VerifyCreatePremiumDb(Collection<PSObject> newPremiumP1DatabaseResult, string databaseName, string serviceObjectiveId)
 {
     Database[] databases = new Database[] { newPremiumP1DatabaseResult.Single().BaseObject as Database };
     Assert.AreEqual(1, databases.Length, "Expecting one database");
     Assert.IsNotNull(databases[0], "Expecting a Database object.");
     Assert.AreEqual(databases[0].Name, databaseName, string.Format("Expecting Database Name:{0}, actual is:{1}", databaseName, databases[0].Name));
     /* SQL Server: Defect 1655888: When creating a premium database, 
      * the immediate returned value do not have valid Edition and Max Database Size info                 
      * We should active the following asserts once the defect is fixed.
      Assert.AreEqual("Premium", databases[0].Edition);
      Assert.AreEqual(10, databases[0].MaxSizeGB);
      Assert.AreEqual(databases[0].AssignedServiceObjectiveId, serviceObjectiveId, string.Format("Expecting Database Edition:{0}, actual is:{1}", serviceObjectiveId, databases[0].AssignedServiceObjectiveId));
      */
     Assert.AreEqual("SQL_Latin1_General_CP1_CI_AS", databases[0].CollationName);
     return databases;
 }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:16,代码来源:AzureSqlDatabaseCertAuthTests.cs


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