internal void DeleteRegistration()
 {
     if (Registration.Delete())
     {
         Registrations.Remove(Registration);
     }
 }
        /// <summary>
        /// Registers the builder as a generator for resolving the given type.
        /// Overwrites existing registrations for the type.
        /// </summary>
        /// <typeparam name="T">The type that shall be registered.</typeparam>
        /// <param name="builder">The function to be executed when the given type is resolved.</param>
        /// <returns>The container.</returns>
        public IDependencyContainer RegisterStrong <T>(Func <IDependencyContainer, T> builder)
        {
            if (IsRegisteredLocal <T>())
            {
                Registrations.Remove(typeof(T));
            }

            Register(builder);
            return(this);
        }
Esempio n. 3
0
        /// <inheritdoc/>
        public void UnRegister(string taskName)
        {
            var task = Registrations.FirstOrDefault(r => r.Name == taskName);

            if (task != null)
            {
                task.Unregister(false);
                Registrations.Remove(task);
            }
        }
        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");
            }
        }