/// <summary> /// Determines whether this type is registered. /// </summary> /// <typeparam name="T">Type</typeparam> /// <returns> /// <c>true</c> if this type is registered; otherwise, <c>false</c>. /// </returns> public bool IsRegistered <T>() { lock (Registrations) { return(Registrations.Find(r => r.RegisteredType == typeof(T) && r.Name == null) != null); } }
public async Task RemoveRegistration(Event @event, Participant participant) { Registration registration = Registrations.Find(x => x.EventId == @event.Id && x.UserName == participant.UserName); bool ok = await _registrationPersistence.Delete(registration.Id); if (ok) { Registrations.Remove(registration); RegistrationDictionary[@event].Remove(participant); } else { throw new BaseException("Remove regi fail"); } }