Example #1
0
 public static void SwitchContent(SavedDataDTO first, SavedData second)
 {
     (first.Message, second.Message)       = (second.Message, first.Message);
     (first.IsLink, second.IsLink)         = (second.IsLink, first.IsLink);
     (first.ClickLimit, second.ClickLimit) = (second.ClickLimit, first.ClickLimit);
     (first.TimeLimit, second.TimeLimit)   = (second.TimeLimit, first.TimeLimit);
 }
Example #2
0
        public static ShortCode ToShortCode(this SavedDataDTO savedDataDTO)
        {
            var shortCode = new ShortCode
            {
                RelatedGuid = savedDataDTO.Guid
            };

            return(shortCode);
        }
Example #3
0
        public static SavedData ToSavedData(this SavedDataDTO savedDataDTO)
        {
            var savedData = new SavedData
            {
                Guid       = savedDataDTO.Guid,
                Message    = savedDataDTO.Message,
                IsLink     = savedDataDTO.IsLink,
                User       = savedDataDTO.User,
                Created    = savedDataDTO.Created,
                TimeLimit  = savedDataDTO.TimeLimit,
                EndTime    = savedDataDTO.EndTime,
                ClickLimit = savedDataDTO.ClickLimit,
                Group      = savedDataDTO.Group
            };

            return(savedData);
        }
Example #4
0
        public static SavedDataDTO ToDTO(this SavedData savedData)
        {
            var savedDataDTO = new SavedDataDTO
            {
                Guid       = savedData.Guid,
                Message    = savedData.Message,
                IsLink     = savedData.IsLink,
                User       = savedData.User,
                Created    = savedData.Created,
                TimeLimit  = savedData.TimeLimit,
                EndTime    = savedData.EndTime,
                ClickLimit = savedData.ClickLimit,
                Group      = savedData.Group,
                Code       = savedData.ShortCode?.Code
            };

            return(savedDataDTO);
        }
Example #5
0
 public static void SendToHistory(this SavedDataDTO savedDataDTO)
 {
     savedDataDTO.TimeLimit  = null;
     savedDataDTO.ClickLimit = -1;
 }