public TravelersController(ITravelerRepository travelers, IReservationRepository reservations, IFlightRepository flights, ILocationRepository locations) { Travelers = travelers; Reservations = reservations; Flights = flights; Locations = locations; }
public CategoryController(ITaskRepository taskRepository, ICategoryRepository categoryRepository, ITravelerRepository userRepository, IItemRepository itemRepository, UserManager <ApplicationUser> userManager) { this._taskRepository = taskRepository; this._categoryRepository = categoryRepository; this._userRepository = userRepository; this._itemRepository = itemRepository; this._userManager = userManager; }
public TravelController(IItemRepository itemRepository, ITravelerRepository travelerRepository, ITravelRepository travelRepository, ITravelItemRepository travelItemRepository, ITravelTaskRepository travelTaskRepository, IActivityRepository activityRepository, UserManager <ApplicationUser> userManager) { this._activityRepository = activityRepository; this._itemRepository = itemRepository; this._travelerRepository = travelerRepository; this._travelRepository = travelRepository; this._travelItemRepository = travelItemRepository; this._travelTaskRepository = travelTaskRepository; this._userManager = userManager; }
public TripController(ITripsRepository LibraryRepository, IConverter convertidorModelos, ITravelerRepository LibraryTravelerRepository) { TripsRepository = LibraryRepository; CustomMapper = convertidorModelos; travelerRepository = LibraryTravelerRepository; }
public TravelerControler(ITravelerRepository travelerRepo) { _travelerRepo = travelerRepo; }
public TravelerController(ITravelerRepository LibraryRepository, IConverter convertidorModelos) { _libraryRepository = LibraryRepository; CustomMapper = convertidorModelos; }
public TravelerController(IDatabaseRepositoryFactory repositoryFactory) { _travelerRepository = repositoryFactory.GetNewTravelerRepository(); }
public ReservationsController() { Reservations = new ReservationRepository(); Travelers = new TravelerRepository(); }
public ItemController(ITravelerRepository userRepository, IItemRepository itemRepository, UserManager <ApplicationUser> userManager) { this._travelerRepository = userRepository; this._itemRepository = itemRepository; this._userManager = userManager; }
public CommentsController(ITravelerRepository eventRepository, IMapper mapper, LinkGenerator linkGenerator) { _eventRepository = eventRepository; _mapper = mapper; _linkGenerator = linkGenerator; }
public static void Main() { Console.WriteLine("TraPaConsole is starting."); //todo connection string IDataAccessor dataAccessor = new DataAccessor(false, "Data Source=ConsoleRunDatabase.db"); using (var dbContext = dataAccessor.GetNewDatabaseContext()) { //dbContext.Database.EnsureDeleted(); dbContext.Database.EnsureCreated(); //dbContext.Database.Migrate(); } IDatabaseRepositoryFactory databaseRepositoryFactory = new DatabaseRepositoryFactory(dataAccessor); ITravelerRepository travelerRepository = databaseRepositoryFactory.GetNewTravelerRepository(); ITravelDateRepository travelDateRepository = databaseRepositoryFactory.GetNewTravelDateRepository(); ITravelerTravelDateReferenceRepository travelerTravelDateReferenceRepository = databaseRepositoryFactory.GetNewTravelerTravelDateReferenceRepository(); Console.WriteLine("Provide the action you would like to execute \n" + "add : add a new traveler to the database \n" + "list : list all travelers \n" + "delete : remove traveler with a given index \n" + "addtravel : add a new travel to the database \n" + "listtravel : list all travels \n" + "deletetravel : remove travel with a given index \n" + "addreference : add a new travel travel date reference to the database \n" + "listreference : list all travel travel date references \n" + "deletereference : remove travel travel date references with a given index \n" + "q : exit"); var flag = true; do { var input = Console.ReadLine(); var punctuation = input.Where(Char.IsPunctuation).Distinct().ToArray(); var words = input.Split().Select(x => x.Trim(punctuation)).ToList(); switch (words[0]) { case "add": try { var traveler = CreateTraveler(words); traveler = travelerRepository.Add(traveler.FirstName, traveler.LastName, traveler.PhoneNumber, traveler.DirectionFrom, traveler.DirectionTo, traveler.DoesPay, traveler.Price); Console.WriteLine($"Traveler was added. Id: '{traveler.Id}'"); } catch (Exception e) { Console.WriteLine("Could not add the traveler to the database. Reason:"); Console.WriteLine(e); } break; case "list": var travelers = travelerRepository.GetAll(); WriteTravelers(travelers); break; case "delete": try { var idToDelete = Int32.Parse(words[1]); travelerRepository.Remove(idToDelete); Console.WriteLine($"Traveler was removed. Id: {idToDelete}"); } catch (Exception e) { Console.WriteLine("Could not remove the traveler from the database. Reason:"); Console.WriteLine(e); } break; case "addtravel": try { var travel = CreateTravel(words); travelDateRepository.Add(travel.TravelName, travel.DateOfTravel); Console.WriteLine("Travel was added."); } catch (Exception e) { Console.WriteLine("Could not add the travel to the database. Reason:"); Console.WriteLine(e); } break; case "listtravel": var travelDates = travelDateRepository.GetAll(); WriteTravels(travelDates); break; case "deletetravel": try { var idToDelete = Int32.Parse(words[1]); travelDateRepository.Remove(idToDelete); Console.WriteLine($"Travel was removed. Id: {idToDelete}"); } catch (Exception e) { Console.WriteLine("Could not remove the travel from the database. Reason:"); Console.WriteLine(e); } break; case "addreference": try { var travelTravelDateReference = CreateTravelTravelDateReference(words); travelerTravelDateReferenceRepository.Add(travelTravelDateReference.TravelerId, travelTravelDateReference.TravelDateId); Console.WriteLine("Traveler - travel date reference was added."); } catch (Exception e) { Console.WriteLine("Could not add the traveler - travel date reference to the database. Reason:"); Console.WriteLine(e); } break; case "listreference": var travelerTravelDateReferences = travelerTravelDateReferenceRepository.GetAll(); WriteTravelTravelDateReferences(travelerTravelDateReferences); break; case "deletereference": try { var travelerId = Int32.Parse(words[1]); var travelDateId = Int32.Parse(words[2]); travelerTravelDateReferenceRepository.Remove(travelerId, travelDateId); Console.WriteLine("Traveler - travel date reference was removed."); } catch (Exception e) { Console.WriteLine("Could not remove the traveler - travel date reference from the database. Reason:"); Console.WriteLine(e); } break; case "q": flag = false; Console.WriteLine("Stopping the application."); break; default: Console.WriteLine(@"Invalid key: {0}, try again.", words[0]); break; } } while (flag); }
public TravelersController(ITravelerRepository travelers) { Travelers = travelers; }
public TaskController(ITravelerRepository travelerRepository, ITaskRepository taskRepository, UserManager <ApplicationUser> userManager) { _travelerRepository = travelerRepository; _taskRepository = taskRepository; _userManager = userManager; }
public TravelerService(ITravelerRepository travelerRepository) { this.travelerRepository = travelerRepository; }
public TravelerService(ITravelerRepository travelerRepository) { this.travelerRepository = travelerRepository ?? throw new ArgumentNullException(nameof(travelerRepository)); }
public TravelersController() { travelers = new TravelerRepository(); }
public UserController(ITravelerRepository userRepository, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager) { this._travelerRepository = userRepository; this._userManager = userManager; this._signInManager = signInManager; }
public CollectionService(ICollectionRepository collectionRepository, ITravelerRepository travelerRepository) { this.collectionRepository = collectionRepository; this.travelerRepository = travelerRepository; }
public TripService(ITripRepository tripRepository, ITravelerRepository travelerRepository) { this.tripRepository = tripRepository; this.travelerRepository = travelerRepository; }