본문 바로가기
MVC

Newtonsoft.Json 검색해보기

by 캡틴노랑이 2015. 7. 31.
반응형

schema = JsonSchema.Parse(@"{
  'type': 'object',
  'properties': {
    'name': {'type':'string'},
    'hobbies': {'type': 'array'}
  }
}"
);

JObject person = JObject.Parse(@"{
  'name': 'James',
  'hobbies': ['.NET', 'LOLCATS']
}"
);

bool valid = person.IsValid(schema);
// true

반응형

'MVC' 카테고리의 다른 글

Json 데이터를 C# 코드로 변환  (81) 2023.03.06
HtmlHelper class  (0) 2015.07.31
MVC 강좌  (0) 2015.07.31

댓글