VkNet.Model.Education.FromJson C# (CSharp) Method

FromJson() public static method

Разобрать из json.
public static FromJson ( VkResponse response ) : Education
response VkResponse Ответ сервера.
return Education
        public static Education FromJson(VkResponse response)
        {
            if (response["university"] == null || response["university"].ToString() == "0")
                return null;

            var education = new Education
            {
                UniversityId = Utilities.GetNullableLongId(response["university"]),
                UniversityName = response["university_name"],
                FacultyId = Utilities.GetNullableLongId(response["faculty"]),
                FacultyName = response["faculty_name"],
                Graduation = (int?)Utilities.GetNullableLongId(response["graduation"])
            };

            if (education.UniversityId.HasValue && education.UniversityId == 0)
                education.UniversityId = null;

            if (education.FacultyId.HasValue && education.FacultyId == 0)
                education.FacultyId = null;

            if (education.Graduation.HasValue && education.Graduation == 0)
                education.Graduation = null;

            education.EducationForm = response["education_form"]; // установлено экcпериментальным путем
            education.EducationStatus = response["education_status"]; // установлено экcпериментальным путем

            return education;
        }
Education