コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, EndContext dbContext, DataInitializer dataInitializer)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }
            // Enable middleware to serve generated Swagger as a JSON endpoint.
            app.UseSwagger();

            // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
            // specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
                c.DocExpansion(DocExpansion.None);
            });

            //app.UseHttpsRedirection();
            app.UseCors(options => options.WithOrigins("http://localhost:4200").AllowAnyMethod().AllowAnyHeader());
            app.UseAuthentication();
            app.UseMvc();
            // ===== Create tables ======
            dbContext.Database.EnsureCreated();
            dataInitializer.Seed().Wait();
        }
コード例 #2
0
 public UsersController(UserRepository userRepository, UserManager <AppUser> userManager,
                        EndContext endContext, FollowerPermissionRepository followerPermissionRepository,
                        FollowingRequestRepository followingRequestRepository)
 {
     _userRepository = userRepository;
     _userManager    = userManager;
     _endContext     = endContext;
     _followerPermissionRepository = followerPermissionRepository;
     _followingRequestRepository   = followingRequestRepository;
 }
コード例 #3
0
        public override int GetHashCode()
        {
            var result = EndContext.GetHashCode();

            if (CompleteLabel != null)
            {
                result += CompleteLabel.GetHashCode();
            }

            if (Parent != null)
            {
                result += Parent.GetHashCode();
            }

            return(result);
        }
コード例 #4
0
 public AccountController(
     UserManager <AppUser> userManager,
     SignInManager <AppUser> signInManager,
     IConfiguration configuration,
     UserRepository userRepository,
     JwtSettings jwtSettings,
     RoleManager <AppRole> roleManager,
     EndContext endContext
     )
 {
     _userManager    = userManager;
     _signInManager  = signInManager;
     _configuration  = configuration;
     _userRepository = userRepository;
     _jwtSettings    = jwtSettings;
     _roleManager    = roleManager;
     _endContext     = endContext;
 }
コード例 #5
0
        public EndContext end()
        {
            EndContext _localctx = new EndContext(_ctx, State);

            EnterRule(_localctx, 4, RULE_end);
            try {
                State = 43;
                _errHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(_input, 2, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 37; Match(END);
                        State = 38; input();
                        State = 39; Match(ENDL);
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 41; Match(END);
                        State = 42; input();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #6
0
ファイル: ActiveEdge.cs プロジェクト: m9ra/ServeRick
 public override int GetHashCode()
 {
     return(Label.GetHashCode() + EndContext.GetHashCode());
 }
コード例 #7
0
ファイル: UserContext.cs プロジェクト: shadowmint/pangul
 protected virtual void OnEndContext()
 {
     EndContext?.Invoke(this, EventArgs.Empty);
 }