Example #1
0
        public async Task <bool> Add(AddFeedbackDto dto)
        {
            var hasRecordOfToday = await _repo.GetUserTodayFeedbacks(dto.UserKey, AbortToken);

            if (hasRecordOfToday.Count > 0)
            {
                return(false);
            }

            var feedback = FeedBack.Create(dto.Title, dto.Content);

            feedback.SetFeedBackUser(dto.UserKey);
            feedback.SetTag(dto.Tag);
            await _repo.AddAsync(feedback);

            return(true);
        }