public AnnonceController(IWebHostEnvironment env, IFavoris favoris, IUpload uploadService, ILogin login) { _env = env; _favorisService = favoris; _uploadService = uploadService; _login = login; }
/// <summary> /// Upload image /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> UploadImagesAsync(this IUpload operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UploadImagesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public ProfileController(UserManager <User> userManager, IUser userService, IUpload uploadService, IConfiguration configuration) { this._userManager = userManager; this._userService = userService; this._uploadService = uploadService; _configuration = configuration; }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload uploadService, IConfiguration configuration) { _userManager = userManager; _userService = userService; _uploadService = uploadService; _configuration = configuration; }
public PraticienController(IWebHostEnvironment env, IRdv rdv, IUpload uploadService, ILogin login) { _env = env; _rdvService = rdv; _uploadSerice = uploadService; _login = login; }
private void AttachNotifications(BackgroundUploader uploader, IUpload upload) { var successToast = ToastContentFactory.CreateToastText02(); successToast.Audio.Content = ToastAudioContent.SMS; successToast.TextHeading.Text = _locService["Toast_Uploads_SuccessReturn_Text"]; successToast.TextBodyWrap.Text = upload.Uploadable.Name; var successXml = successToast.GetXml(); ToastAudioHelper.SetSuccessAudio(successXml); var successNotification = new ToastNotification(successXml); var failToast = ToastContentFactory.CreateToastText02(); failToast.Audio.Content = ToastAudioContent.IM; failToast.TextHeading.Text = _locService["Toast_Uploads_Fail_Text"]; failToast.TextBodyWrap.Text = upload.Uploadable.Name; var failXml = failToast.GetXml(); ToastAudioHelper.SetFailAudio(failXml); var failNotification = new ToastNotification(failXml); uploader.SuccessToastNotification = successNotification; uploader.FailureToastNotification = failNotification; }
public async Task <ActionResult> UploadPost <T>(IUpload uploadViewModel) { // Get EXCEL File var fileBase = Request.Files.Get(0); if (fileBase != null && fileBase.ContentLength > 0) { // Check file type if (ExcelHelper.CheckIsExcel(fileBase)) { // Save to TABLE GenerateUploadRecord await DbManager.Add(GenerateUploadRecord(uploadViewModel)); var entity = GetEntityListFromExcel(fileBase.InputStream, uploadViewModel); // Save to database if (entity.Any()) { DbManager.AddRange(entity as List <T>); } await DbManager.GetContext().SaveChangesAsync().ConfigureAwait(continueOnCapturedContext: false); return(new HttpStatusCodeResult(HttpStatusCode.Accepted)); } } return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError)); }
public DocumentBuilder( WebClient webClient, DocumentConverter documentConverter, IUpload upload) { this.webClient = webClient; this.documentConverter = documentConverter; iUpload = upload; }
private void ProcessTraceFile(TraceFile trace, Archive archive, Config config, LineCoverageMerger coverageMerger) { if (trace.IsEmpty()) { logger.Info("Archiving {trace} because it does not contain any coverage", trace.FilePath); archive.ArchiveEmptyFile(trace.FilePath); return; } string processPath = trace.FindProcessPath(); if (processPath == null) { logger.Info("Archiving {trace} because it does not contain a Process= line", trace.FilePath); archive.ArchiveFileWithoutProcess(trace.FilePath); return; } Config.ConfigForProcess processConfig = config.CreateConfigForProcess(processPath); IUpload upload = uploadFactory.CreateUpload(processConfig, fileSystem); if (processConfig.PdbDirectory == null) { ProcessMethodCoverage(trace, archive, processConfig, upload); } else { ProcessLineCoverage(trace, archive, config, processConfig, upload, coverageMerger); } }
public ForumController(IForum forumService, IPost postService, IUpload uploadService, IConfiguration configuration) //it's not a concrete instance of our forum service but rather we are passing in this IForum interface and then we are gonna use dependency injection here and we are gonna tell that anytime we as for something that implements this IForum interface to go ahead and pass that concrete instance of our forum service { _forumService = forumService; _postService = postService; _uploadService = uploadService; _configuration = configuration; }
public ForumController(IForum forumService, IPost postService, IUpload uploadService, IConfiguration configuration) { _forumService = forumService; _postService = postService; _uploadService = uploadService; _configuration = configuration; }
public ForumController(IForum forumService, IConfiguration configuration, IApplicationUser userService, IUpload uploadService) { _forumService = forumService; _configuration = configuration; _userService = userService; _uploadService = uploadService; }
public async Task FinalizeUploadAsync(IUpload upload, IUploadBlock[] blocks) { int retryCount = 0; Exception lastException; do { if (retryCount > 0) { await Task.Delay(retryPolicy.GetDelay(retryCount)).ConfigureAwait(false); } try { var request = new CompleteMultipartUploadRequest(client.Host, upload, blocks); await client.CompleteMultipartUploadAsync(request).ConfigureAwait(false); return; } catch (S3Exception ex) when(ex.IsTransient) { lastException = ex; } retryCount++; }while (retryPolicy.ShouldRetry(retryCount)); throw lastException; }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload uploadService, IHostingEnvironment he) { this.userManager = userManager; this.userService = userService; this.uploadService = uploadService; this._hosting = he; }
public CFDIController(ApplicationDbContext context, IUpload upload, IWebHostEnvironment environment, IEmailSender emailSender) { _context = context; _upload = upload; _environment = environment; EmailSender = emailSender; }
public PlatformController(IPlatform platformService, IMail mailService, IUpload uploadService, IConfiguration configuration) { _platformService = platformService; _mailService = mailService; _uploadService = uploadService; _configuration = configuration; }
public ForumController(IForum forumService, IPost postService, IUpload uploadService, IHostingEnvironment he) { this.forumService = forumService; this.postService = postService; this.uploadService = uploadService; this._hosting = he; }
public void SetUpMocks() { var uploadMock = new Mock <IUpload>(); uploadMock.Setup(upload => upload.GetTargetId()).Returns("constant-string"); Upload = uploadMock.Object; }
public static IUpload GetInstance(string assemlyName, bool isFormat) { //IUpload upload = null; //try //{ // upload = (IUpload)Activator.CreateInstance(Type.GetType(string.Format("OceanCMS.Plugin.Upload.{0}.UtilUpload, OceanCMS.Plugin.Upload.{0}", assemlyName), false, true)); //} //catch //{ // upload = new UtilUpload(); //} if (!_instance.ContainsKey(assemlyName)) { lock (lockHelper) { if (!_instance.ContainsKey(assemlyName)) { IUpload p = null; try { p = (IUpload)Activator.CreateInstance(Type.GetType(string.Format("Ocean.Plugins.Upload.{0}.UtilUpload, Ocean.Plugins", assemlyName), false, true)); } catch { p = new UtilUpload(); } _instance.Add(assemlyName, p); } } } IUpload upload = (IUpload)_instance[assemlyName]; return(upload); }
public ApplicationUserService(IConfiguration configuration, ApplicationDbContext context, UserManager <ApplicationUser> userManager, IUpload uploadService) { _config = configuration; _context = context; _userManager = userManager; _uploadService = uploadService; AzureBlobStorageConnection = _config.GetConnectionString("AZURE_BLOB_STORAGE_USER_IMAGES"); }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload uploadService, IConfiguration configService) { _userManager = userManager; _userService = userService; _uploadService = uploadService; //For file upload handling, ex. profile pictures. _configuration = configService; }
public SettingService(ApplicationDbContext context, IUpload upload, IHostingEnvironment env) { _context = context; _upload = upload; _env = env; }
public ProfileController(UserManager <ApplicationUsers> userManager, IApplicationUser userService, IUpload uploadService) { _userManager = userManager; _userService = userService; _uploadService = uploadService; }
private BackgroundTransferContentPart CreateContentPart(IUpload upload, string fieldName) { var part = new BackgroundTransferContentPart(fieldName, $"{upload.Uploadable.Name}{upload.Uploadable.Extension}"); part.SetHeader("Content-Type", upload.Uploadable.Source.GetContentType()); part.SetFile(upload.Uploadable.Source.GetFile()); return(part); }
public GameService(IConfiguration configuration, ApplicationDbContext context, IUserGame userGameServices, IUpload uploadService) { _config = configuration; _context = context; _userGameServices = userGameServices; _uploadService = uploadService; AzureBlobStorageConnection = _config.GetConnectionString("AZURE_BLOB_STORAGE_USER_IMAGES"); }
public ForumControllerTest() { _forumService = Substitute.For <IForum>(); _postService = Substitute.For <IPost>(); _cofigService = Substitute.For <IConfiguration>(); _uploadService = Substitute.For <IUpload>(); _controller = new ForumController(_forumService, _postService, _cofigService, _uploadService); }
public async Task <IUploadBlock> UploadBlock(IUpload upload, int number, Stream stream) { var partRequest = new UploadPartRequest(client.Region, upload, number); partRequest.SetStream(stream); return(await client.UploadPartAsync(partRequest).ConfigureAwait(false)); }
public HomeController(ILogger <HomeController> logger, ITransientInterface transientService, IScopedInterface scopedService, ISingeletonInterface singletonService, IUpload uploadService) { _logger = logger; _transientService = transientService; _scopedService = scopedService; _singletonService = singletonService; _uploadService = uploadService; }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload uploadService) { this.userManager = userManager; this.userService = userService; this.uploadService = uploadService; }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload upload, IConfiguration configuration, IPost postService, ApplicationDbContext context) { _userManager = userManager; _userService = userService; _uploadService = upload; _configuration = configuration; _postService = postService; _context = context; }
public CommonController(IUpload upload) { this._upload = upload; }
public ScreenshotService() { upload = new Upload(); repository = new ScreenshotRepository(); }