本文整理汇总了C#中Dog.SetValidationValue方法的典型用法代码示例。如果您正苦于以下问题:C# Dog.SetValidationValue方法的具体用法?C# Dog.SetValidationValue怎么用?C# Dog.SetValidationValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dog
的用法示例。
在下文中一共展示了Dog.SetValidationValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerialzationDictonary
public void SerialzationDictonary()
{
List<Dog> dogs = new List<Dog>();
Dog testExpando = new Dog
{
Before = "Before!",
After = "After!"
};
List<string> keys = new List<string>() {"48001", "48003", "48005", "48007", "48009", "48011", "48013", "48015", "48017", "48019", "48021", "48023"};
testExpando.SetValidationValue("keys", keys);
testExpando.SetValidationValue("DecimalPoints", 2);
//serialize to string using newtonsoft to memic webapi request
var jsonString = NewtonsoftJson.JsonConvert.SerializeObject(testExpando);
//deserialize with Json.net to mimick webapi
Dog objectToStore = NewtonsoftJson.JsonConvert.DeserializeObject<Dog>(jsonString, _settings);
var objectId = SaveToDb(objectToStore);
Dog loadedObject;
//load the saved object from the db.
using (var session1 = _localStore.OpenSession())
{
loadedObject = session1.Load<Dog>(objectId);
}
var loadedObjectJsonString = RavenJson.JsonConvert.SerializeObject(testExpando);
var dog = 2;
}