public HomeController(IMediaFacade mediaService, IVideoRepository videoRepository, ILocatorService locatorService) { this.mediaService = mediaService; this.videoRepository = videoRepository; this.locatorService = locatorService; }
public ProjectMapper(ILocatorService locator) { mapper = new MapperConfiguration(config => { config.ConstructServicesUsing(locator.Locate); MapToDomain(config); MapFromDomain(config); }).CreateMapper(); }
protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (this._mediaService == null) { this._mediaService = new MediaService(requestContext.HttpContext.Session["mctx"] as CloudMediaContext); this._assetSErvice = new AssetService(this.MediaService); this._jobService = new JobService(this.MediaService); this._locatorService = new LocatorService(this.MediaService); } base.Initialize(requestContext); }
private bool CreateDatabase(ILocatorService scope) { var databaseManager = scope.Locate <DatabaseManager>(); try { databaseManager.CreateAndConnectNewDatabase("./db.s3db"); return(true); } catch (Exception e) { Logger.Log(LogLevel.Error, e); return(false); } }
private async Task <bool> ConnectDatabase(ILocatorService scope, string path) { var databaseManager = scope.Locate <DatabaseManager>(); try { await databaseManager.Connect(path); return(true); } catch (Exception) { return(false); } }
public static CommandLineBuilder Configure(this CommandLineBuilder builder, ILocatorService container) { var project = new Option <string>("--project", GetDefaultProject); var authType = new Option <AuthType>("--auth-type", "Authentication") { Required = true }; var auth = new Option <string>("--auth", "Authentication string"); var profile = new Argument <string>("profile"); var verbose = new Option <bool>("--verbose", () => false); var configureCommand = new Command("configure") { profile, project, authType, auth, verbose }; configureCommand.Handler = CommandHandler.Create <ProfileCreationOptions>(options => { var creator = container.Locate <ProfileCreationUnit>(options); return(creator.Create()); }); var deployCommand = new Command("deploy") { profile, project, authType, auth, new Option <string>("--configuration", () => "Debug", "Build configuration"), verbose }; deployCommand.Handler = CommandHandler.Create <DeploymentOptions>(async options => { var deploymentRequest = container.Locate <DeploymentUnit>(options); var deploy = await deploymentRequest.Deploy(); if (deploy.IsFailure) { Log.Error($"Deployment failed {deploy.Error}"); } }); builder.AddCommand(configureCommand); builder.AddCommand(deployCommand); return(builder); }
public TestInstanceBuilder(ILocatorService container) : base(container) { }
public HomeController() { //TODO: Implement IoC Container this.locatorService = new MediaLocatorService(new VideoLibraryConfigurationManager(), new OneDayReadOnlyAccessPolicyFactory()); this.videoRepository = new AzureVideoRepository(new VideoLibraryConfigurationManager(), new AzureMediaServicesMediaFacade(new VideoLibraryConfigurationManager(), new ThumbnailService(new VideoLibraryConfigurationManager()))); }
/// <summary> /// Initializes a new instance of the <see cref="LocatorController"/> class. /// </summary> /// <param name="loggerService">The logger service.</param> /// <param name="locatorService">The locator service.</param> public LocatorController(ILoggerService loggerService, ILocatorService locatorService) : base(loggerService) { this.locatorService = locatorService; }
public LocatorController( ILocatorService locatorService ) { _locatorService = locatorService; }
public TopSecretController(IMessageRecoveryService messageRecovery, ILocatorService locatorService) { _messageRecovery = messageRecovery ?? throw new ArgumentNullException(nameof(messageRecovery)); _locatorService = locatorService ?? throw new ArgumentNullException(nameof(locatorService)); }
static LocatorHelper() { service = IoC.Resolve<ILocatorService>("LocatorService"); }
public ViewModelFactory(ILocatorService locatorService) { this.locatorService = locatorService; }
public LocatorsController(ILocatorService locatorService) { _locatorService = locatorService ?? throw new ArgumentNullException(nameof(locatorService)); }
public ImportILocatorService(ILocatorService locatorService) { LocatorService = locatorService; }
public InstanceBuilder(ILocatorService container) { this.container = container; }
static LocatorHelper() { service = IoC.Resolve <ILocatorService>("LocatorService"); }