public VoteCategoryEntity MapToVoteCategoryEntity(VoteCategoryDTO source, VoteCategoryEntity target = null)
        {
            if (source == null)
            {
                return(null);
            }

            // search for target in database
            if (target == null)
            {
                DefaultGet(source, ref target);
            }

            // if target is not in database, create
            if (target == null)
            {
                target = DbContext.CustomVoteCategories.Create();
                DbContext.CustomVoteCategories.Add(target);
            }

            target.DefaultPenalty = source.DefaultPenalty;
            target.Index          = source.Index;
            target.Text           = source.Text;

            return(target);
        }
        public VoteCategoryDTO MapToVoteCategoryDTO(VoteCategoryEntity source, VoteCategoryDTO target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = new VoteCategoryDTO();
            }

            target.CatId          = source.CatId;
            target.Text           = source.Text;
            target.DefaultPenalty = source.DefaultPenalty;
            target.Index          = source.Index;

            return(target);
        }