public HyperVController(string hyperVServerName, string login, string password) { ServerName = hyperVServerName; Login = login ?? string.Empty; Password = password ?? string.Empty; HyperVRemoteOptions configuration = new HyperVRemoteOptions { HyperVServerName = ServerName, HyperVUserName = Login, HyperVUserPassword = Password }; _provider = new HyperVProvider(configuration); }
public static IServiceCollection AddHyperVRemote(this IServiceCollection services, Action <HyperVRemoteOptions> configure) { var options = new HyperVRemoteOptions(); if (configure != null) { services.AddOptions(); services.Configure <HyperVRemoteOptions>(configure); } services.AddTransient <IHyperVProvider, HyperVProvider>(); return(services); }