public CloudinaryService(IConfiguration configuration)
 {
     cloudinary = CloudinaryHelper.GetCloudinary(
         configuration["Cloudinary:Cloud"],
         configuration["Cloudinary:ApiKey"],
         configuration["Cloudinary:ApiSecret"]
         );
 }
Ejemplo n.º 2
0
        public CloudinaryServices(IConfiguration configuration)
        {
            this.configuration = configuration;
            string CloudName = this.configuration["CloudinarySetting:CloudName"];
            string ApiKey    = this.configuration["CloudinarySetting:ApiKey"];
            string ApiSecret = this.configuration["CloudinarySetting:ApiSecret"];

            helper = new CloudinaryHelper(CloudName, ApiKey, ApiSecret);
        }
Ejemplo n.º 3
0
 public AdminController(DataContext cntx, UserManager <User> userManager, IMapper mapper,
                        IOptions <CloudinarySettings> cloudinaryConfgig, IDatingRepository repo)
 {
     _repo        = repo;
     _mapper      = mapper;
     _cntx        = cntx;
     _userManager = userManager;
     _cloudinary  = CloudinaryHelper.GetCloudinaryInstance(cloudinaryConfgig);
 }
Ejemplo n.º 4
0
        public PhotoController(IDatingRepository repo, IMapper mapper, IOptions <CloudinarySettings> cloudinaryConfgig, DataContext cntx)
        {
            _cntx = cntx;
            _cloudinaryConfgig = cloudinaryConfgig;
            _mapper            = mapper;
            _repo = repo;

            _cloudinary = CloudinaryHelper.GetCloudinaryInstance(cloudinaryConfgig);
        }
Ejemplo n.º 5
0
 public ProductService(ProductContext context,
                       IMapper mapper,
                       ILogger <ProductService> logger,
                       CloudinaryHelper cloudinaryHelper)
 {
     _context          = context;
     _cloudinaryHelper = cloudinaryHelper;
     _mapper           = mapper;
     _logger           = logger;
 }
Ejemplo n.º 6
0
 public PagesController(ICRUDRepo repo, IOptions <CloudinarySettings> cloudinarySettings)
 {
     CloudinaryDotNet.Account account = new CloudinaryDotNet.Account()
     {
         ApiKey    = cloudinarySettings.Value.ApiKey,
         ApiSecret = cloudinarySettings.Value.ApiSecret,
         Cloud     = cloudinarySettings.Value.CloudName
     };
     _cloudHelper = new CloudinaryHelper(account);
     _repo        = repo;
 }
Ejemplo n.º 7
0
 public SectionsController(ICRUDRepo repo, IMapper mapper, IOptions <CloudinarySettings> cloudSettings)
 {
     _mapper = mapper;
     _repo   = repo;
     _cloud  = new CloudinaryHelper(new CloudinaryDotNet.Account()
     {
         ApiKey    = cloudSettings.Value.ApiKey,
         ApiSecret = cloudSettings.Value.ApiSecret,
         Cloud     = cloudSettings.Value.CloudName
     });
 }
Ejemplo n.º 8
0
        public WordsController(ICRUDRepo repo, IMapper mapper, IOptions <CloudinarySettings> cloudinarySettings, IUploadService dropbox)
        {
            var cloudAccount = new CloudinaryDotNet.Account()
            {
                ApiKey    = cloudinarySettings.Value.ApiKey,
                ApiSecret = cloudinarySettings.Value.ApiSecret,
                Cloud     = cloudinarySettings.Value.CloudName
            };

            _mapper  = mapper;
            _repo    = repo;
            _cloud   = new CloudinaryHelper(cloudAccount);
            _dropbox = dropbox;
        }
Ejemplo n.º 9
0
        public QuestionsController(ICRUDRepo repo, IMapper mapper, IOptions <CloudinarySettings> cloudSetting, IUploadService dropBox, IConfiguration config)
        {
            _dropBox = dropBox;
            var account = new CloudinaryDotNet.Account()
            {
                ApiSecret = cloudSetting.Value.ApiSecret,
                ApiKey    = cloudSetting.Value.ApiKey,
                Cloud     = cloudSetting.Value.CloudName
            };

            _helper = new CloudinaryHelper(account);
            _mapper = mapper;
            _repo   = repo;
            _config = config;
        }
Ejemplo n.º 10
0
        public AccountsController(IAuthRepo repo, ICRUDRepo cRUDRepo,
                                  IMapper mapper, IConfiguration config, IOptions <CloudinarySettings> cloudinarySettings, Func <ServiceEnum, IAuthService> serviceResolver,

                                  UserManager <Models.Account> userManager, RoleManager <Models.Role> roleManager,
                                  SignInManager <Models.Account> signinManager)
        {
            _roleManager     = roleManager;
            _signinManager   = signinManager;
            _userManager     = userManager;
            _cRUDRepo        = cRUDRepo;
            _config          = config;
            _googleService   = serviceResolver(ServiceEnum.Google);
            _facebookService = serviceResolver(ServiceEnum.Facebook);
            _mapper          = mapper;
            _repo            = repo;
            var account = new CloudinaryDotNet.Account()
            {
                Cloud     = cloudinarySettings.Value.CloudName,
                ApiKey    = cloudinarySettings.Value.ApiKey,
                ApiSecret = cloudinarySettings.Value.ApiSecret
            };

            _cloud = new CloudinaryHelper(account);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Test deleting the image from cloudinary with images public id
 /// </summary>
 /// <param name="publicId">public id from cloudinary</param>
 /// <returns>instance of <see cref="HttpStatusCode"/></returns>
 private async Task <HttpStatusCode> DeleteAsync_FromCloudinary(string publicId)
 {
     return(await CloudinaryHelper.DeleteAsync(publicId));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Tests uploading image to cloudinary from the web (random picture) and fs
 /// Assert is true if the return object has a status 200
 /// </summary>
 /// <param name="imgUrl">image url from cloudinary</param>
 /// <returns>instance of <see cref="CloudinaryImageOperationDto"/></returns>
 private async Task <CloudinaryImageOperationDto> UploadAsync_Test(string imgUrl)
 {
     return(await CloudinaryHelper.UploadAsync(imgUrl));
 }