本文整理汇总了C#中IdmResource.GetAttrValue方法的典型用法代码示例。如果您正苦于以下问题:C# IdmResource.GetAttrValue方法的具体用法?C# IdmResource.GetAttrValue怎么用?C# IdmResource.GetAttrValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdmResource
的用法示例。
在下文中一共展示了IdmResource.GetAttrValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSchema
public static async Task<Schema> GetSchema(IdmResource idmResource)
{
var objTypeName = idmResource.GetAttrValue("Name");
var objectType = await Client.GetSchemaAsync(objTypeName);
return objectType;
}
示例2: It_should_be_able_to_set_string_based_single_value_properties
public void It_should_be_able_to_set_string_based_single_value_properties()
{
var it = new IdmResource();
it.ObjectID = "foo";
Assert.AreEqual("foo", it.ObjectID);
it.ObjectType = "foo";
Assert.AreEqual("foo", it.ObjectType);
it.Description = "foo";
Assert.AreEqual("foo", it.Description);
it.DisplayName = "foo";
Assert.AreEqual("foo", it.DisplayName);
it.MVObjectID = "foo";
Assert.AreEqual("foo", it.MVObjectID);
it.Locale = "foo";
Assert.AreEqual("foo", it.Locale);
// and attributes
it.SetAttrValue("foo", "bar");
Assert.AreEqual("bar", it.GetAttrValue("foo"));
}
示例3: It_should_return_null_for_empty_attributes
public void It_should_return_null_for_empty_attributes()
{
var it = new IdmResource();
Assert.IsNull(it.GetAttr("foo"));
Assert.IsNull(it.GetAttrValue("foo"));
Assert.IsNull(it.GetAttrValues("foo"));
}
示例4: It_can_SettAttrValue_nullable_null_value_and_come_back_as_null_as_either_Value_or_ToInt
public void It_can_SettAttrValue_nullable_null_value_and_come_back_as_null_as_either_Value_or_ToInt()
{
var it = new IdmResource();
it.SetAttrValue("foo", null);
var result1 = it.GetAttrValue("foo");
var result2 = it.GetAttr("foo").ToInteger();
var result3 = it.GetAttr("foo").ToDateTime();
var result4 = it.GetAttr("foo").ToBinary();
var result5 = it.GetAttr("foo").ToBool();
Assert.IsNull(result1);
Assert.IsNull(result2);
Assert.IsNull(result3);
Assert.IsNull(result4);
Assert.IsNull(result5);
}