Beispiel #1
0
        public static async Task <Result> BrokerHasApartmentAd(
            this ICurrentUser currentUser,
            IBrokerRepository brokerRepository,
            int apartmentAdId,
            CancellationToken cancellationToken)
        {
            var brokerId = await brokerRepository.GetBrokerId(
                currentUser.UserId,
                cancellationToken);

            var brokerHasApartment = await brokerRepository.HasApartmentAd(
                brokerId,
                apartmentAdId,
                cancellationToken);

            return(brokerHasApartment
                ? Result.Success
                : "You cannot edit this apartment ad.");
        }