public Course(CrmCourse crmCourse)
        {
            Id         = crmCourse.Id;
            CreatedAt  = crmCourse.CreatedOn;
            UpdatedAt  = crmCourse.msk12_lastmodifieddate;
            Status     = crmCourse.msk12_status;
            Title      = crmCourse.msk12_title;
            CourseCode = crmCourse.msk12_coursecode;

            if (crmCourse.msk12_grades != null)
            {
                Grades = crmCourse.msk12_grades.Split(",");
            }

            if (crmCourse._msk12_academicsession_value != null)
            {
                SchoolYearAcademicSession = new AcademicSession()
                {
                    Id = crmCourse._msk12_academicsession_value
                };
            }

            if (crmCourse._msk12_account_value != null)
            {
                Org = new Org()
                {
                    Id = crmCourse._msk12_account_value
                };
            }
        }
        public CrmAcademicSession(AcademicSession session)
        {
            Id                     = msk12_sourcedid = session.Id;
            msk12_status           = session.Status;
            msk12_lastmodifieddate = session.UpdatedAt;
            msk12_startdate        = session.StartDate;
            msk12_enddate          = session.EndDate;
            msk12_sessiontype      = session.Type;

            if (session.ParentAcademicSession != null)
            {
                _msk12_parentsession_value = session.ParentAcademicSession.Id;
            }
        }
        public AcademicSession(CrmAcademicSession crmSession)
        {
            Id         = crmSession.Id;
            Status     = crmSession.msk12_status;
            CreatedAt  = crmSession.CreatedOn;
            UpdatedAt  = crmSession.msk12_lastmodifieddate;
            Title      = crmSession.msk12_title;
            StartDate  = crmSession.msk12_startdate;
            EndDate    = crmSession.msk12_enddate;
            Type       = crmSession.msk12_sessiontype;
            SchoolYear = crmSession.msk12_schoolyear;

            if (crmSession._msk12_parentsession_value != null)
            {
                ParentAcademicSession = new AcademicSession()
                {
                    Id = crmSession._msk12_parentsession_value
                };
            }
        }
        public new void AsJson(JsonWriter writer, string baseUrl)
        {
            writer.WriteStartObject();
            base.AsJson(writer, baseUrl);

            writer.WritePropertyName("title");
            writer.WriteValue(Title);

            if (!String.IsNullOrEmpty(Description))
            {
                writer.WritePropertyName("description");
                writer.WriteValue(Description);
            }

            writer.WritePropertyName("assignDate");
            writer.WriteValue(AssignDate.ToString("yyyy-MM-dd"));

            writer.WritePropertyName("dueDate");
            writer.WriteValue(DueDate.ToString("yyyy-MM-dd"));

            writer.WritePropertyName("category");
            LineItemCategory.AsJsonReference(writer, baseUrl);

            writer.WritePropertyName("class");
            IMSClass.AsJsonReference(writer, baseUrl);

            writer.WritePropertyName("gradingPeriod");
            AcademicSession.AsJsonReference(writer, baseUrl);

            writer.WritePropertyName("resultValueMin");
            writer.WriteValue(ResultValueMin.ToString());

            writer.WritePropertyName("resultValueMax");
            writer.WriteValue(ResultValueMax.ToString());

            writer.WriteEndObject();
            writer.Flush();
        }