private async Task LoginDevEnvironment() { if (FabricSettings.LoginDevEnvironment && FabricSettings.IsEnvironment(SecurityConstants.DevEnvironment)) { //ApplicationUser user = await this.userManager.FindByNameAsync(SecuritySettings.NootusProfileUserName); //await this.signInManager.SignInAsync(user, false); await Task.CompletedTask; } }
public Startup(IHostingEnvironment env, FabricSettings settings) { Settings = settings; var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true) .AddEnvironmentVariables(); Configuration = builder.Build(); }
private static FileServerOptions GetStaticFileOptions(FabricSettings fabricSettings) { if (fabricSettings.IsLocal) { return(new FileServerOptions()); } var ass = typeof(Startup).Assembly; var manifestEmbeddedProvider = new ManifestEmbeddedFileProvider(ass, "\\wwwroot\\"); return(new FileServerOptions { FileProvider = manifestEmbeddedProvider, }); }
protected override IEnumerable <ServiceInstanceListener> CreateServiceInstanceListeners() { var myConfigPackage = Context.CodePackageActivationContext.GetConfigurationPackageObject("Config"); var fabricSettings = new FabricSettings(myConfigPackage); var webFactoryOptions = new WebClientFactoryOptions { FabricSettings = fabricSettings, EndpointName = "Web", LogAction = (ctx, log) => ServiceEventSource.Current.ServiceMessage(ctx, log), ContentRoot = (new DirectoryInfo(Directory.GetCurrentDirectory()).Parent?.FullName ?? string.Empty) + "\\Fabric.Web" }; return(new[] { OrleansServiceInstanceListenerFactory.Get(fabricSettings), WebClientFactory.Get(webFactoryOptions) }); }
//************************************************************** //* Author : Jacob Atchley //* Date : 08:29:2018 03:57 PM //* Comment: Adds our services to the Orleans IoC Container //************************************************************** private static void ConfigureServices(IServiceCollection services, FabricSettings settings) { services.AddSingleton <IAppContextSettings>(new AppContextSettings(settings.Db)); services.AddScoped <IAppDbContext, AppDbContext>(); services.AddScoped <ICrudRepo <Guid, Person>, PeopleRepository>(); }
private static void Configure(ServiceContext context, ISiloHostBuilder builder, FabricSettings settings) { builder.Configure <ClusterOptions>(options => { options.ServiceId = context.ServiceName.ToString(); options.ClusterId = settings.IsLocal ? "development" : "production"; }); builder.ConfigureLogging(logging => logging.AddDebug()); builder.UseAzureStorageClustering(options => options.ConnectionString = settings.TableStorage); var activation = context.CodePackageActivationContext; var endpoints = activation.GetEndpoints(); //************************************************************** //* Author : Jacob Atchley //* Date : 08:29:2018 04:00 PM //* Comment: Bound to MyStatelessService/PackageRoot/Config/ServiceManifest.xml //************************************************************** var siloEndpoint = endpoints["OrleansSiloEndpoint"]; var gatewayEndpoint = endpoints["OrleansProxyEndpoint"]; var hostname = context.NodeContext.IPAddressOrFQDN; builder.UseDashboard(options => { options.Port = endpoints["OrleansDashboard"].Port; }); builder.ConfigureEndpoints(hostname, siloEndpoint.Port, gatewayEndpoint.Port); builder.ConfigureApplicationParts(parts => { parts.AddApplicationPart(typeof(MyFirstGrain).Assembly).WithReferences(); parts.AddFromApplicationBaseDirectory(); }); builder.ConfigureServices((ctx, coll) => ConfigureServices(coll, settings)); }
/// <summary> /// This factory creates a new listener for the Oreleans /// tier of our application. The table storage connection /// strings and other configuration information is presented /// in FabricSettings. /// </summary> /// <param name="settings">The <see cref="FabricSettings"/></param> /// <returns>A <see cref="ServiceInstanceListener"/> </returns> public static ServiceInstanceListener Get(FabricSettings settings) { return(OrleansServiceListener.CreateStateless( (ctx, builder) => Configure(ctx, builder, settings))); }