예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DbLogic"/> class.
 /// Sets the intial values of the properties.
 /// </summary>
 /// <param name="model">Initial GameModel.</param>
 /// <param name="drillRepo">Initial DrillRepository.</param>
 /// <param name="brickRepo">Initial BrickRepository.</param>
 /// <param name="connRepo">Initial ConnRepository.</param>
 public DbLogic(GameModel model, IDrillRepository drillRepo, IBrickRepository brickRepo, IConnRepository connRepo)
 {
     this.gameModel = model;
     this.drillRepo = drillRepo;
     this.brickRepo = brickRepo;
     this.connRepo  = connRepo;
 }
예제 #2
0
        public static async Task <IEnumerable <Drill> > GetCategoryOrFailAsync(this IDrillRepository repository, string category)
        {
            var drills = await repository.GetAllByCategoryAsync(category);

            if (drills == null)
            {
                throw new Exception($"Drill with category: '{category}' was not found");
            }

            return(drills);
        }
예제 #3
0
 public DrillsController(IDrillRepository drillRepository)
 {
     this.drillRepository = drillRepository;
 }
 public DrillsController(IDrillRepository drillRepository)
 {
     this.drillRepository = drillRepository;
 }
예제 #5
0
 public DrillsApi(IDrillRepository drillRepository)
 {
     this.drillRepository = drillRepository;
 }
예제 #6
0
 public DrillService(IDrillRepository drillRepository, IMapper mapper)
 {
     _drillRepository = drillRepository;
     _mapper          = mapper;
 }