public int Evaluate(EvaluationContext context) { return _opinions .Select(x => x.GetPosition(context)) .Where(x => x >= 0) .Last(); }
public int GetPosition(EvaluationContext context) { if (context.NumberOfAttendees >= context.Configuration.HardLimit) { context.Logger.Info(String.Format("User entry for '{0}' is on the waiting list, hard limit of {1} reached with {2} entries", context.User.UserName, context.Configuration.HardLimit, context.NumberOfAttendees), "SYSTEM"); return context.WaitingListEnd; } return int.MinValue; }
public int GetPosition(EvaluationContext context) { if (context.NumberOfAttendees >= context.Configuration.MaximumAttendees && context.User.Data.Sponsoring <= decimal.Zero) { context.Logger.Info(String.Format("User entry for '{0}' is on the waiting list, maximum attendee count of {1} is reached with {2} entries", context.User.UserName, context.Configuration.MaximumAttendees, context.NumberOfAttendees), "SYSTEM"); return context.WaitingListEnd; } return int.MinValue; }