Exemplo n.º 1
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="context"></param>
 /// <param name="signInManager"></param>
 /// <param name="userManager"></param>
 /// <param name="httpContextAccessor"></param>
 public AccountController(XdocDbContext context, ApplicationSignInManager signInManager, ApplicationUserManager userManager, IHttpContextAccessor httpContextAccessor) : base(context, signInManager, userManager, httpContextAccessor)
 {
 }
Exemplo n.º 2
0
        public void SetCrocoApplication(IServiceCollection services)
        {
            var memCache = new MemoryCache(new MemoryCacheOptions());

            services.AddSingleton <IMemoryCache, MemoryCache>(s => memCache);

            var baseOptions = new EFCrocoApplicationOptions
            {
                CacheManager         = new ApplicationCacheManager(memCache),
                GetDbContext         = () => XdocDbContext.Create(Configuration),
                RequestContextLogger = new CrocoWebAppRequestContextLogger(),
                FileOptions          = new CrocoFileOptions
                {
                    SourceDirectory       = Env.WebRootPath,
                    ImgFileResizeSettings = new List <ImgFileResizeSetting>
                    {
                        new ImgFileResizeSetting
                        {
                            ImageSizeName = ImageSizeType.Icon.ToString(),
                            MaxHeight     = 50,
                            MaxWidth      = 50
                        },

                        new ImgFileResizeSetting
                        {
                            ImageSizeName = ImageSizeType.Small.ToString(),
                            MaxHeight     = 200,
                            MaxWidth      = 200
                        },

                        new ImgFileResizeSetting
                        {
                            ImageSizeName = ImageSizeType.Medium.ToString(),
                            MaxHeight     = 500,
                            MaxWidth      = 500
                        }
                    },
                },
                RootPath         = Env.ContentRootPath,
                AfterInitActions = ApplicationActions
            }.GetApplicationOptions();


            baseOptions.AddDelayedApplicationLogger()
            .AddHangfireEventSourcerAndJobManager();

            var options = new CrocoWebApplicationOptions()
            {
                ApplicationUrl = "https://findtask.ru",
                CrocoOptions   = baseOptions,
            };

            var application = new XDocWebApplication(options)
            {
                IsDevelopment = Env.EnvironmentName == "Development"
            };

            CrocoApp.Application = application;

            services.AddSingleton(CrocoApp.Application);
        }