Exemplo n.º 1
0
        public MeetingModelBase Deserialize(string json)
        {
            byte[] data = Encoding.UTF8.GetBytes(json);
            var    t    = new MeetingModelRegular();

            return(t);
        }
Exemplo n.º 2
0
        public string Serialize(MeetingModelRegular value)
        {
            var options = new JsonWriterOptions
            {
                Indented = true
            };

            using (var stream = new System.IO.MemoryStream())
            {
                using (var writer = new System.Text.Json.Utf8JsonWriter(stream, options))
                {
                    writer.WriteStartObject();
                    writer.WriteString("MeetingType", MeetingType);
                    writer.WriteString("ID", ID);
                    writer.WriteString("DayOfMeeting", DayOfMeeting);
                    writer.WriteString("Toastmaster", Toastmaster);
                    writer.WriteString("Speaker1", Speaker1);
                    writer.WriteString("Speaker2", Speaker2);
                    writer.WriteString("GeneralEvaluator", GeneralEvaluator);
                    writer.WriteString("Evaluator1", Evaluator1);
                    writer.WriteString("Evaluator2", Evaluator2);
                    writer.WriteString("TableTopics", TableTopics);
                    writer.WriteString("AhCounter", AhCounter);
                    writer.WriteString("Grammarian", Grammarian);
                    writer.WriteString("Timer", Timer);
                    writer.WriteString("QuizMaster", QuizMaster);
                    writer.WriteString("Video", Video);
                    writer.WriteString("HotSeat", HotSeat);
                    writer.WriteString("Attendees", Attendees?.ToString());
                    writer.WriteString("Resolved", Resolved);
                    writer.WriteEndObject();
                }
                return(Encoding.UTF8.GetString(stream.ToArray()));
            }

            // return JsonSerializer.ToString<MeetingModelRegular>(value, options);
        }