public async Task <IGetEntityPlaceByPlaceIdQueryResult> Handle(GetEntityPlaceByPlaceIdQuery query)
        {
            if (string.IsNullOrWhiteSpace(query.PlaceId))
            {
                return(GetEntityPlaceByPlaceIdQueryResult.Empty);
            }

            if (query.PlaceId.IsDirectPlace())
            {
                return(GetEntityPlaceByPlaceIdQueryResult.ForbiddenResult);
            }

            var date = _datetimeProvider.GetLocalNow().Date;

            var posSpec = new HasActiveEntityEntitySalesEntityPlaceSpecification(date)
                          .And(new GetByIdEntityPlaceSpecification(query.PlaceId));

            var EntityPlace = (await _queryHandler.HandleAsync(posSpec.ToExpression(), asp => asp)).FirstOrDefault();

            return(EntityPlace == null ? GetEntityPlaceByPlaceIdQueryResult.Empty : new GetEntityPlaceByPlaceIdQueryResult(EntityPlace.EpGuid, EntityPlace.EntityBasePoint.AgentCode));
        }
 public Task <IGetEntityPlaceByPlaceIdQueryResult> Handle(GetEntityPlaceByPlaceIdQuery query) => Task.FromResult <IGetEntityPlaceByPlaceIdQueryResult>(null);