本文整理汇总了C#中Metadata.AsDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# Metadata.AsDictionary方法的具体用法?C# Metadata.AsDictionary怎么用?C# Metadata.AsDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Metadata
的用法示例。
在下文中一共展示了Metadata.AsDictionary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestConstructAsDictionary1
public void TestConstructAsDictionary1()
{
string owner = "Washington State University Libraries";
string ownerGroup = "Washington State University";
string[] coOwners = { "CoOwner1", "CoOwner2" };
long created = DateTime.Now.ToBinary();
long updated = DateTime.Now.AddDays(1).ToBinary();
string target = "http://wsulibs.wsu.edu/";
string status = Metadata.MetadataStatus.Public;
IDictionary<string, string> map = new Dictionary<string, string>();
map.Add(Metadata.MetadataKeys.Owner, owner);
map.Add(Metadata.MetadataKeys.OwnerGroup, ownerGroup);
map.Add(Metadata.MetadataKeys.CoOwners, string.Join(";", coOwners));
map.Add(Metadata.MetadataKeys.Created, created.ToString());
map.Add(Metadata.MetadataKeys.Updated, updated.ToString());
map.Add(Metadata.MetadataKeys.Target, target);
map.Add(Metadata.MetadataKeys.Status, status);
Metadata metadata = new Metadata(map);
foreach (var x in metadata.AsDictionary())
Assert.IsTrue(x.Value == map[x.Key]);
}