예제 #1
0
 private static void CopyOptionalFields(JsonMetadata from, Demo to)
 {
     to.NonInteractive            = from.NonInteractive;
     to.StudioLinkToMediaDatabase = from.StudioLinkToMediaDatabase;
     to.StudioLinkToIndexList     = from.StudioLinkToIndexList;
     to.ConferenceOnly            = from.ConferenceOnly;
 }
예제 #2
0
        public static Demo ToDemo(this JsonMetadata json)
        {
            var demo = new Demo();

            demo.Title           = json.Title;
            demo.DescriptionHtml = ConvertToDescription(json.DescriptionLines);

            demo.Assets       = json.Assets.Select(ToModel).ToList();
            demo.Walkthroughs = json.Walkthroughs.Select(ToModel).ToList();
            demo.Slug         = json.Slug.ToLower();

            CopyOptionalFields(from: json, to: demo);

            return(demo);
        }