protected override void RegisterTypes(IContainerRegistry containerRegistry) { containerRegistry.RegisterForNavigation <NavigationPage>(); BootStrapperIoC.Register(containerRegistry); App.Current.Resources.Add("IoC", containerRegistry.GetContainer()); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.Configure <IdentityOptions>(options => { options.Password.RequireLowercase = true; options.Password.RequireDigit = false; options.Password.RequireNonAlphanumeric = false; options.Password.RequireUppercase = false; options.Password.RequiredLength = 6; options.Password.RequiredUniqueChars = 1; }); var mapperConfiguration = new MapperConfiguration(config => { config.AddProfile(new MappingsProfile()); }); var mapper = mapperConfiguration.CreateMapper(); services.AddSingleton(mapper); services.AddMvc().AddJsonOptions(options => { options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.Configure <AppSettings>(Configuration.GetSection("AppSettings")); services.ConfigureApplicationCookie(options => { //options.LoginPath = "/Login"; //options.ExpireTimeSpan = TimeSpan.FromSeconds(15); }); //services.AddDbContext<Infra.Data.Context.MySQLContext>(options => // options.UseMySql(Configuration.GetConnectionString("MySqlConnection"))); //services.AddIdentity<ApplicationUser, IdentityRole>() // .AddDefaultUI(UIFramework.Bootstrap4) // .AddEntityFrameworkStores<Infra.Data.Context.MySQLContext>(); BootStrapperIoC.RegisterServices(services, Configuration); }