Example #1
0
        /// <inheritdoc />
        public async Task <DomainCommandResponse> Handle(UpdateEventDomainCommand request, CancellationToken cancellationToken)
        {
            try
            {
                this.UnitOfWork.EventRepository.Update(request.ProjectedAs <Event>());

                // this.Logger.Info($"Change in db table {typeof(Area).Name} : {returnValue} entities");
                var retResp = new DomainCommandResponse
                {
                    IsSuccess = true,
                    Message   = "Entity was Updated",
                    Object    = request
                };

                return(await Task.FromResult(retResp));
            }
            catch (Exception ex)
            {
                var ret = new DomainCommandResponse {
                    Message = ex.Message
                };
                return(await Task.FromResult(ret));
            }
        }
Example #2
0
        public void ReturnCorrectAdmUpdateEventCommand()
        {
            var com = new UpdateEventDomainCommand(true);

            Assert.AreEqual(com.Command, UpdateSpCommandPattern.AdminUpdate.UpdateEventAdm);
        }
Example #3
0
        public void ReturnCorrectUpdateEventCommand()
        {
            var com = new UpdateEventDomainCommand();

            Assert.AreEqual(com.Command, UpdateSpCommandPattern.UpdateEvent);
        }