static void Main(string[] args) { IConfiguration config = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build(); var endpoint = config["GraphConnectionEndPoint"]; var primaryKey = config["GraphConnectionPrimaryKey"]; var database = config["GraphConnectionDatabase"]; var collection = config["GraphConnectionCollection"]; GraphConfig.SetGraphDataBaseConnection(endpoint, primaryKey, database, collection); CVGenerator generator = new CVGenerator(); generator.ProcessCV(args[0]); Console.WriteLine("Convertion finalisée"); Console.WriteLine("Appuyer sur un bouton pour sortir"); Console.ReadKey(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); endpoint = Configuration.GetSection("GraphConnectionEndPoint").Value; primaryKey = Configuration.GetSection("GraphConnectionPrimaryKey").Value; database = Configuration.GetSection("GraphConnectionDatabase").Value; collection = Configuration.GetSection("GraphConnectionCollection").Value; GraphConfig.SetGraphDataBaseConnection(endpoint, primaryKey, database, collection); services = TokenConfigurations(services); services.AddIdentity <ApplicationUser, ApplicationRole>() .AddEntityFrameworkStores <ApplicationDbContext>() .AddDefaultTokenProviders(); services.ConfigureApplicationCookie(options => { options.Cookie.HttpOnly = true; options.ExpireTimeSpan = TimeSpan.FromMinutes(30); options.LoginPath = "/Account/Login"; options.AccessDeniedPath = "/Account/AccessDenied"; options.SlidingExpiration = true; }); services.AddCors(); services.AddMvc(); services.AddTransient <IEmailSender, EmailSender>(); services.AddSingleton(Configuration); services.AddSingleton <IEmailSender, EmailSender>(); services.Configure <AuthMessageSenderOptions>(Configuration); services.AddDistributedMemoryCache(); services.AddSession(options => { // Set a short timeout for easy testing. options.IdleTimeout = TimeSpan.FromSeconds(10); options.Cookie.HttpOnly = true; }); }