Esempio n. 1
0
        public IActionResult Add(Reminder reminder)
        {
            var result = _reminderService.Add(reminder);

            if (result.Success)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }
Esempio n. 2
0
        public ActionResult <ReminderDto> Add(Reminder reminder)
        {
            var ServiceResult = _reminderListService.Add(reminder);

            if (ServiceResult.ResponseCode != ResponseCode.Success)
            {
                return(BadRequest(ServiceResult.Error));
            }

            var result = new ReminderDto
            {
                Id          = ServiceResult.Result.Id,
                Description = ServiceResult.Result.Description,
                Message     = ServiceResult.Result.Message,
                DateDue     = ServiceResult.Result.DateDue,
                UserId      = ServiceResult.Result.UserId
            };

            return(Ok(result));
        }