コード例 #1
0
        protected virtual string SerializeModelToString(T model)
        {
            switch (modelFormat)
            {
            case ModelFormat.XML:
                return(Xml.ToXml(model));

            case ModelFormat.JSON:
                return(StdJson.ObjectToString(model, indented: true));

            default:
                throw new Exception($"Model format {modelFormat} not implemented in SerializeModelToString");
            }
        }
コード例 #2
0
 protected virtual string SerializeModelToString(T model)
 {
     return(Xml.ToXml(model));
 }