Esempio n. 1
0
        public UsersController(UserManager <GoshoSecurityUser> userManager, IRepository <GoshoSecurityUser> repository,
                               IOptions <CognitiveServicesFaceConfig> cognitiveServicesConfig, IAccountService accountService,
                               IPhotoService photoService)
        {
            this.userManager             = userManager;
            this.cognitiveServicesConfig = cognitiveServicesConfig.Value;
            this.accountService          = accountService;
            this.photoService            = photoService;

            faceClient = new FaceClient(new ApiKeyServiceClientCredentials(this.cognitiveServicesConfig.ApiKey))
            {
                Endpoint = this.cognitiveServicesConfig.ApiEndpoint
            };
        }
Esempio n. 2
0
        public PhotoService(IOptions <CognitiveServicesFaceConfig> cognitiveServicesConfig,
                            IOptions <CloudinarySettings> settings,
                            IRepository <GoshoSecurityUser> usersRepository,
                            IRepository <Photo> photosRepository)
        {
            this.cognitiveServicesConfig = cognitiveServicesConfig.Value;
            this.cloudinarySettings      = settings.Value;
            this.usersRepository         = usersRepository;
            this.photosRepository        = photosRepository;

            var account = new Account(
                this.cloudinarySettings.CloudName,
                this.cloudinarySettings.ApiKey,
                this.cloudinarySettings.ApiSecret);

            this.cloudinary = new Cloudinary(account);

            faceClient = new FaceClient(new ApiKeyServiceClientCredentials(this.cognitiveServicesConfig.ApiKey))
            {
                Endpoint = this.cognitiveServicesConfig.ApiEndpoint
            };
        }