public async Task Handle_GenericGetByGuidRequest_GetsSite()
        {
            var request  = new GetByGuidRequest <Site, SiteGetDto>(_site.Guid);
            var response = await Mediator.HandleAsync(request);

            Assert.IsFalse(response.HasErrors);
            Assert.IsNotNull(response.Data);
            Assert.AreEqual(_site.Id, response.Data.Id);
            Assert.AreEqual(_site.Guid, response.Data.Guid);
        }
Beispiel #2
0
        public GetByGuidResponse GetByGuid(GetByGuidRequest request)
        {
            GetByGuidResponse response = new GetByGuidResponse();

            try
            {
                response.User = new EFUserMethodsCAP().GetByGuid(request.Guid);

                response.Result = new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.SUCCESS
                };
            }
            catch (Exception exception)
            {
                response.Result = (new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace
                });
            }
            return(response);
        }
        } // GetById

        public GetByGuidResponse GetByGuid(GetByGuidRequest request)
        {
            GetByGuidResponse response = new GetByGuidResponse();

            try
            {
                response.Ac4yPersistentChild = new Ac4yPersistentChildEFCap().GetByGuid(request.Guid);

                response.Result = new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.SUCCESS
                };
            }
            catch (Exception exception)
            {
                response.Result = (new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace
                });
            }

            return(response);
        } // GetByGuid
 public GetByGuidResponse GetByGuid(GetByGuidRequest request)
 {
     return new Ac4yPersistentChildEFService().GetByGuid(request);
 }