Example #1
0
        public static byte[] ToBytes(this ArticleDirectory subject)
        {
            subject.Verify();

            var json = Json.Default.Serialize(subject);

            return(Encoding.UTF8.GetBytes(json));
        }
Example #2
0
        public static void WriteToFile(this ArticleDirectory subject, string filePath)
        {
            filePath.VerifyNotEmpty(nameof(filePath));

            subject.Verify();

            var json = Json.Default.SerializeFormat(subject);

            File.WriteAllText(filePath, json);
        }