本文整理汇总了C#中ResourceManager.DeleteDynamicResource方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.DeleteDynamicResource方法的具体用法?C# ResourceManager.DeleteDynamicResource怎么用?C# ResourceManager.DeleteDynamicResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.DeleteDynamicResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddUpdateDeleteDynamicDataTest
private static void AddUpdateDeleteDynamicDataTest()
{
Console.WriteLine("Add_Update_Delete_DynamicData Test");
//arrange
ICacheProvider cacheProvider =
new CacheProvider(new CacheItemPolicy
{
AbsoluteExpiration = DateTimeOffset.MinValue,
SlidingExpiration = TimeSpan.Zero
});
IResourceManager resourceManager = new ResourceManager(cacheProvider);
string expectedvalue = "5";
string expectedNewValue = "6";
var dynamicData = new DynamicTranslationsData
{
DescriptionValue = "5",
DynamicKey = "5",
Value = "5",
LanguageId = 1
};
//Add dynamic data
resourceManager.AddResource(dynamicData);
Console.WriteLine("The dynamic data were added successfully");
string actualValue = resourceManager.GetResource(TranslationTypeEnum.DynamicTranslation,
dynamicData.DynamicKey, "uk");
Console.WriteLine("ADDING... Actual value:{0} \t Expected value:{1}", actualValue, expectedvalue);
Console.WriteLine("Press anykey to continue...");
Console.ReadKey();
//Update dynamic data
dynamicData.Value = "6";
resourceManager.UpdateResource(dynamicData);
Console.WriteLine("The dynamic data were updateded successfully");
string actualNewValue = resourceManager.GetResource(TranslationTypeEnum.DynamicTranslation,
dynamicData.DynamicKey, "uk");
Console.WriteLine("UPDATING... Actual value:{0} \t Expected value:{1}", actualNewValue, expectedNewValue);
Console.WriteLine("Press anykey to continue...");
Console.ReadKey();
//Delete dynamic data
resourceManager.DeleteDynamicResource(new List<string>(){"5"});
Console.WriteLine("The dynamic data were deleted successfully");
Console.WriteLine("Press anykey to finish current test.");
Console.WriteLine("-----------------------------");
}