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

            if (entity != null)
            {
                result.Add(RedmineKeys.NAME, entity.Name);
                result.Add(RedmineKeys.IDENTIFIER, entity.Identifier);
                result.Add(RedmineKeys.DESCRIPTION, entity.Description);
                result.Add(RedmineKeys.HOMEPAGE, entity.HomePage);
                result.Add(RedmineKeys.INHERIT_MEMBERS, entity.InheritMembers);
                result.Add(RedmineKeys.IS_PUBLIC, entity.IsPublic);

                result.WriteIdOrEmpty(entity.Parent, RedmineKeys.PARENT_ID, string.Empty);
                result.WriteArray(RedmineKeys.CUSTOM_FIELDS, entity.CustomFields, new IssueCustomFieldConverter(), serializer);

                result.WriteIdsArray(RedmineKeys.TRACKER_IDS, entity.Trackers);
                result.WriteNamesArray(RedmineKeys.ENABLED_MODULE_NAMES, entity.EnabledModules);
              
                var root = new Dictionary<string, object>();
                root[RedmineKeys.PROJECT] = result;
                return root;
            }

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

            if (entity != null)
            {
                result.WriteIdIfNotNull(entity.User, RedmineKeys.USER_ID);
                result.WriteIdsArray(RedmineKeys.ROLE_IDS, entity.Roles);

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

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

            if (entity != null)
            {
                result.Add(RedmineKeys.NAME, entity.Name);
                result.WriteIdsArray(RedmineKeys.USER_IDS, entity.Users);

                var root = new Dictionary<string, object>();
                root[RedmineKeys.GROUP] = 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;
        }