Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnimalController"/> class.
 /// </summary>
 /// <param name="animalService"></param>
 public AnimalController(IAnimalService animalService, ILodgingService lodgingService, IStayService stayService, IWebHostEnvironment hostEnvironment)
 {
     _animalService   = animalService;
     _lodgingService  = lodgingService;
     _stayService     = stayService;
     _hostEnvironment = hostEnvironment;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TreatmentController"/> class.
 /// </summary>
 /// <param name="treatmentRepository"></param>
 public TreatmentController(ITreatmentService treatmentService, IStayService stayService,
                            IAnimalService animalService, ILodgingService lodgingService,
                            UserManager <ApplicationUser> userManager)
 {
     _treatmentService = treatmentService;
     _animalService    = animalService;
     _stayService      = stayService;
     _lodgingService   = lodgingService;
     _userManager      = userManager;
 }
Exemple #3
0
        private static IEnumerable <Hotel> GetHotels()
        {
            Uri serviceUri = new Uri("net.tcp://localhost:8000/lodging", UriKind.Absolute);

            ChannelFactory <ILodgingService> cf = new ChannelFactory <ILodgingService>(
                new NetTcpBinding(),
                new EndpointAddress(serviceUri)
                );

            ILodgingService ch = cf.CreateChannel();

            return(ch.GetHotels());
        }
Exemple #4
0
        private static IEnumerable <Hotel> GetHotels()
        {
            Uri serviceUri = null;

            ChannelFactory <ILodgingService> cf = new ChannelFactory <ILodgingService>(
                new NetTcpRelayBinding(),
                new EndpointAddress(serviceUri)
                );

            TransportClientEndpointBehavior endpointBehavior = new TransportClientEndpointBehavior();

            endpointBehavior.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider("owner", "f0f/xIwKqxR0IqZHuzsVmLktTTReNOg93qjJ1KUr+kA=");
            cf.Endpoint.EndpointBehaviors.Add(endpointBehavior);

            ILodgingService ch = cf.CreateChannel();

            return(ch.GetHotels());
        }
Exemple #5
0
        private static IEnumerable <Hotel> GetHotelsFromRelay()
        {
            Uri serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", "sb20532[Your Name]", "lodging");

            ChannelFactory <ILodgingService> cf = new ChannelFactory <ILodgingService>(
                new NetTcpRelayBinding(),
                new EndpointAddress(serviceUri)
                );

            TransportClientEndpointBehavior endpointBehavior = new TransportClientEndpointBehavior();

            endpointBehavior.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("RootManageSharedAccessKey", "<put your access key here>");
            cf.Endpoint.EndpointBehaviors.Add(endpointBehavior);

            ILodgingService ch = cf.CreateChannel();

            return(ch.GetHotels());
        }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StayController"/> class.
 /// </summary>
 /// <param name="stayRepository"></param>
 public StayController(IStayService stayService, IAnimalService animalService, ILodgingService lodgingService)
 {
     _stayService    = stayService;
     _animalService  = animalService;
     _lodgingService = lodgingService;
 }
Exemple #7
0
 public LodgingController()
 {
     lodgingService = new LodgingService();
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LodgingController"/> class.
 /// </summary>
 /// <param name="lodgingRepository"></param>
 public LodgingController(ILodgingService lodgingService)
 {
     _lodgingService = lodgingService;
 }