Пример #1
0
        public object Put(SaveEmail request)
        {
            var success = _emailService.Update(request.email);

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            return new ServiceResult<Email>
            {
                Success = success,
                Result = request.email,
                Errors = issues
            };
        }
Пример #2
0
        /*
        public object Post(SaveEmailEvent request)
        {
         /*   int id;
            var success = _emailService.Create(request.EventDescription, out id);

            if (success)
                request.EventDescription.ID = id;

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;
            */
        /*    return new ServiceResult<Email>
            {
                Success = false,//success,
                Result = null,//request.EventDescription,
                Errors = null//issues
            };
        }

        public object Put(SaveEmailEvent request)
        {
          /*  var success = _emailService.Update(request.EventDescription);

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            return new ServiceResult<Email>
            {
                Success = success,
                Result = request.EventDescription,
                Errors = issues
            };*/
        /*  return new ServiceResult<Email>
            {
                Success = false,//success,
                Result = null,//request.EventDescription,
                Errors = null//issues
            };
        }*/
        public object Post(SaveEmail request)
        {
            int id;
            var success = _emailService.Create(request.email, out id);

            if (success)
                request.email.ID = id;

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            return new ServiceResult<Email>
            {
                Success = success,
                Result = request.email,
                Errors = issues
            };
        }