public ScheduledWorkoutsController(ScheduledWorkoutRepository scheduledWorkoutRepository, WorkoutRepository workoutRepository, UserRepository userRepository, IMapper mapper) { this.scheduledWorkoutRepository = scheduledWorkoutRepository; this.workoutRepository = workoutRepository; this.userRepository = userRepository; this.mapper = mapper; }
public PostgreSQLRepositoryTests() { _appConfiguration = new AppConfiguration(); _context = new MyContext(_appConfiguration.PostgreSQL); _repository = new DbRepository(_context); _secRepository = new UsersMealsRepository(_context); _workoutRepository = new WorkoutRepository(_context); _context.Database.EnsureCreated(); }
public UnitOfWork(ApplicationDbContext context) { _context = context; Workouts = new WorkoutRepository(context); Exercises = new ExerciseRepository(context); Cardios = new CardioRepository(context); Achievements = new AchievementsRepository(context); Users = new ApplicationUserRepository(context); DailyMenus = new DailyMenuRepository(context); Foods = new FoodsRepository(context); Measurements = new MeasurementsRepository(context); }
public DayViewModel() { DayAdd = new Day(); DayAdd.Date = DateTime.Now; DayList = new ObservableCollection <Day>(new DayRepository().GetAll().OrderByDescending(o => o.Date)); WorkoutList = new WorkoutRepository().GetAll().OrderByDescending(o => o.ExpirationDate).ToList(); WorkoutAdd = WorkoutList.FirstOrDefault(); SaveCommand = new Command(SaveDay); LoadCommand = new Command <Day>(LoadDay); DeleteCommand = new Command <Day>(DeleteDay); }
public ExerciseDayViewModel(Day day) { DayAdd = day; ExerciseDayAdd = new ExerciseDay(); ExerciseDayList = new ObservableCollection <ExerciseDay>(new ExerciseDayRepository().GetAll().Where(p => p.DayId == day.Id)); ExerciseList = new WorkoutRepository().GetAll().FirstOrDefault(p => p.Id == day.WorkoutId).ExerciseList; ExerciseAdd = ExerciseList.FirstOrDefault(); SaveCommand = new Command(SaveExerciseDay); LoadCommand = new Command <ExerciseDay>(LoadExerciseDay); DeleteCommand = new Command <ExerciseDay>(DeleteExerciseDay); }
public WorkoutRepositoryTests() { System.Reflection.FieldInfo fiw = typeof(WorkoutRepository).GetField("_instance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); Assert.NotNull(fiw); fiw.SetValue(null, null); _workoutRepository = WorkoutRepository.getInstance(); System.Reflection.FieldInfo fie = typeof(ExerciseRepository).GetField("_instance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); Assert.NotNull(fie); fie.SetValue(null, null); _exerciseRepository = ExerciseRepository.getInstance(); PrepareData(); }
public static List <WorkoutItem> GetAllWorkouts() { List <WorkoutItem> result = new List <WorkoutItem>(); List <WorkoutModel> dbWorkouts = WorkoutRepository.GetAllWorkouts(); foreach (WorkoutModel dbWorkout in dbWorkouts) { result.Add(new WorkoutItem() { WorkoutName = dbWorkout.workoutName }); } return(result); }
public WorkoutService() { _workoutRepository = new WorkoutRepository(); _userRepository = new UserRepository(); }
public WorkoutService(WorkoutRepository repo) { _repo = repo; }
public StartController() { workrepo = new WorkoutRepository(); entryrepo = new EntryRepository(); }
static void Main() { WindowFormsFactory _formsFactory = new WindowFormsFactory(); MainController mainController = new MainController(_formsFactory, ExerciseRepository.getInstance(), WorkoutRepository.getInstance(), WeightMeasureRepository.getInstance()); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain(mainController)); }
public WorkoutsController() { _repo = new WorkoutRepository(); }