示例#1
0
 public CartController(ICharacterRepository rep, ICartProvider cartProvider,
                       IWeekProvider weekProvider, IVoteRepository voteRepository, IUserProvider userProvider)
 {
     repository          = rep;
     this.cartProvider   = cartProvider;
     this.weekProvider   = weekProvider;
     this.voteRepository = voteRepository;
     this.userProvider   = userProvider;
 }
 public ManageController(
     ICharacterRepository repository,
     IVoteRepository voteRepository,
     IUserProvider userProvider,
     IWeekProvider weekProvider)
 {
     this.repository     = repository;
     this.voteRepository = voteRepository;
     this.userProvider   = userProvider;
     this.weekProvider   = weekProvider;
 }
示例#3
0
 public MainController(ICartProvider cartProvider, IUserProvider userProvider,
                       IRepository <Character> charactersRepository, IRepository <Vote> votesRepository, IRepository <VoteItem> voteItemsRepository,
                       IRepository <ApplicationUser> usersRepository, IWeekProvider weekProvider)
 {
     this.charactersRepository = charactersRepository;
     this.votesRepository      = votesRepository;
     this.voteItemsRepository  = voteItemsRepository;
     this.usersRepository      = usersRepository;
     this.weekProvider         = weekProvider;
     this.cartProvider         = cartProvider;
     this.userProvider         = userProvider;
 }
示例#4
0
 public CharacterController(
     ICharacterRepository productRepository,
     IVoteRepository voteRepository,
     IUserProvider userProvider,
     IWeekProvider weekProvider,
     IMessageRepository messageRepository)
 {
     this.repository        = productRepository;
     this.voteRepository    = voteRepository;
     this.weekProvider      = weekProvider;
     this.messageRepository = messageRepository;
     this.userProvider      = userProvider;
 }
示例#5
0
        public static IDictionary <BaseRunable, string> GetOptions()
        {
            IDictionary <BaseRunable, string> options = new Dictionary <BaseRunable, string>();
            StringBuilder stringBuilder = new StringBuilder();

            // Loop over all the runables.
            foreach (BaseRunable runable in _runnables)
            {
                Type runableType = runable.GetType();

                //Check if the class implements a week provider interface.
                if (typeof(IWeekProvider).IsAssignableFrom(runableType))
                {
                    IWeekProvider weekProvider = (IWeekProvider)runable;
                    stringBuilder.Append($"Week {weekProvider.Week}, ");
                }

                //Check if the class provides a lesson provider.
                if (typeof(ILessonProvider).IsAssignableFrom(runableType))
                {
                    ILessonProvider lessonProvider = (ILessonProvider)runable;
                    stringBuilder.Append($"Lesson {lessonProvider.Lesson}, ");
                }

                // Check if the class implements a single or multiple assignment interface.
                if (typeof(ISingleAssignmentProvider).IsAssignableFrom(runableType))
                {
                    ISingleAssignmentProvider singleAssignment = (ISingleAssignmentProvider)runable;
                    stringBuilder.Append($"Assignment; {singleAssignment.AssignmentId}.");
                }
                else if (typeof(IMultipleAssignmentsProvider).IsAssignableFrom(runableType))
                {
                    IMultipleAssignmentsProvider multiAssignment = (IMultipleAssignmentsProvider)runable;
                    stringBuilder.Append($"Assignments; {String.Join(" and ", multiAssignment.AssignmentIds)}.");
                }

                //Store the option.
                options.Add(runable, stringBuilder.ToString());
                stringBuilder.Clear();
            }

            return(options);
        }
示例#6
0
 public VoteController(IRepository repo, IUserProvider userProvider, IWeekProvider weekProvider)
 {
     repository   = repo;
     UserProvider = userProvider;
     WeekProvider = weekProvider;
 }