Exemplo n.º 1
0
        /// <summary>
        /// Delete a gaming patron from a service. This is a destructive operation.
        /// </summary>
        /// <param name="managerId">Manager ID</param>
        /// <param name="serviceId">Target service ID</param>
        /// <param name="patronId">Target patron ID</param>
        public async Task DeleteGamingPatron(string managerId, string serviceId, string patronId)
        {
            // Ensure the manager has access to the given service.
            await _EnsureManagerCanAccessService(managerId, serviceId);

            // Lookup service information.
            var service = await _database.GetGamingServiceById(serviceId);

            // Throw an exception if the service is not active.
            if (!service.IsActive)
            {
                throw new ServiceIsNotActiveException();
            }

            // Delete the gaming patron.
            await _database.DeleteGamingPatron(serviceId, patronId);
        }