public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            var entity = obj as TimeEntry;
            var result = new Dictionary<string, object>();

            if (entity != null)
            {
                result.WriteIdIfNotNull(entity.Issue, RedmineKeys.ISSUE_ID);
                result.WriteIdIfNotNull(entity.Project, RedmineKeys.PROJECT_ID);
                result.WriteIdIfNotNull(entity.Activity, RedmineKeys.ACTIVITY_ID);
               
                if (!entity.SpentOn.HasValue) entity.SpentOn = DateTime.Now;

                result.WriteDateOrEmpty(entity.SpentOn, RedmineKeys.SPENT_ON);
                result.Add(RedmineKeys.HOURS, entity.Hours);
                result.Add(RedmineKeys.COMMENTS, entity.Comments);
                result.WriteArray(RedmineKeys.CUSTOM_FIELDS, entity.CustomFields, new IssueCustomFieldConverter(), serializer);

                var root = new Dictionary<string, object>();
                root[RedmineKeys.TIME_ENTRY] = result;
                return root;
            }

            return result;
        }
        public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            var entity = obj as Version;
           
            var result = new Dictionary<string, object>();

            if (entity != null)
            {
                result.Add(RedmineKeys.NAME, entity.Name);
                result.Add(RedmineKeys.STATUS, entity.Status.ToString());
                result.Add(RedmineKeys.SHARING, entity.Sharing.ToString());
                result.Add(RedmineKeys.DESCRIPTION, entity.Description);

                var root = new Dictionary<string, object>();
                result.WriteDateOrEmpty(entity.DueDate, RedmineKeys.DUE_DATE);
				root[RedmineKeys.VERSION] = result;
                return root;
            }

            return result;
        }
        public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            var entity = obj as Issue;
            var result = new Dictionary<string, object>();

            if (entity != null)
            {
                result.Add(RedmineKeys.SUBJECT, entity.Subject);
                result.Add(RedmineKeys.DESCRIPTION, entity.Description);
                result.Add(RedmineKeys.NOTES, entity.Notes);
                if (entity.Id != 0)
                {
                    result.Add(RedmineKeys.PRIVATE_NOTES, entity.PrivateNotes);
                }
                result.Add(RedmineKeys.IS_PRIVATE, entity.IsPrivate);
                result.WriteIdIfNotNull(entity.Project, RedmineKeys.PROJECT_ID);
                result.WriteIdIfNotNull(entity.Priority, RedmineKeys.PRIORITY_ID);
                result.WriteIdIfNotNull(entity.Status, RedmineKeys.STATUS_ID);
                result.WriteIdIfNotNull(entity.Category, RedmineKeys.CATEGORY_ID);
                result.WriteIdIfNotNull(entity.Tracker, RedmineKeys.TRACKER_ID);
                result.WriteIdIfNotNull(entity.AssignedTo, RedmineKeys.ASSIGNED_TO_ID);
                result.WriteIdIfNotNull(entity.FixedVersion, RedmineKeys.FIXED_VERSION_ID);
                result.WriteValueOrEmpty(entity.EstimatedHours, RedmineKeys.ESTIMATED_HOURS);

                result.WriteIdOrEmpty(entity.ParentIssue, RedmineKeys.PARENT_ISSUE_ID);
                result.WriteDateOrEmpty(entity.StartDate, RedmineKeys.START_DATE);
                result.WriteDateOrEmpty(entity.DueDate, RedmineKeys.DUE_DATE);
                result.WriteDateOrEmpty(entity.UpdatedOn, RedmineKeys.UPDATED_ON);
                result.WriteValueOrDefault(entity.DoneRatio, RedmineKeys.DONE_RATIO);

                result.WriteArray(RedmineKeys.UPLOADS, entity.Uploads, new UploadConverter(), serializer);
                result.WriteArray(RedmineKeys.CUSTOM_FIELDS, entity.CustomFields, new IssueCustomFieldConverter(), serializer);

                result.WriteIdsArray(RedmineKeys.WATCHER_USER_IDS, entity.Watchers);

                //EASY REDMINE
                result.WriteValueOrEmpty(entity.ActivityId, RedmineKeys.ACTIVITY_ID);

                var root = new Dictionary<string, object>();
                root[RedmineKeys.ISSUE] = result;
                return root;
            }

            return result;
        }