public TService GetService <TService>() where TService : class { var moduleKey = typeof(TService).Name; var key = GetWorkContextService().GetBusinessLogicKeyName(moduleKey); return(Invoke <TService> .Call(GenerateKey <TService>(key))); }
public ConfigService() { this._repositories = Invoke <IRepositoryFactory> .Call(); _userSession = Invoke <IServiceFactory> .Call() .GetWorkContextService() .GetCurrentUserSession(); }
public WorkContextService() { _repository = Invoke <IKernelRepository> .Call(); _sessionManager = Invoke <ISessionManager> .Call(); userSession = _sessionManager.GetCurrentSession(); if (userSession == null) { throw new BusinessException(Constants.Message.Exception.KeySentNotFound); } }
public TokenController() { service = Invoke <IUserService> .Call(); }
protected BaseRepository() { this.repository = Invoke <IRepository <T> > .Call(); }
protected BaseApiController() : base(Invoke <TServiceFactory> .Call().GetService <TService>()) { }
public BaseSystemService() { repositories = Invoke <IRepositoryFactory> .Call(); }
public IUserRepository GetUserRepository() { return(Invoke <IUserRepository> .Call()); }
public ITemplateRepository GetTemplateRepository() { return(Invoke <ITemplateRepository> .Call()); }
public IWorkContextService GetWorkContextService() { return(Invoke <IWorkContextService> .Call()); }
public IUserService GetUserService() { return(Invoke <IUserService> .Call()); }
public IShiftService GetSihftService() { return(Invoke <IShiftService> .Call()); }
public INurseService GetNurseService() { return(Invoke <INurseService> .Call()); }
public MobilController() { services = Invoke <IServiceFactory> .Call(); }
protected internal BaseCommonRepository() { this._repository = Invoke <TRepositoryProvider> .Call(); }
public IRoleRepository GetRoleRepository() { return(Invoke <IRoleRepository> .Call()); }
public IMenuRepository GetMenuRepository() { return(Invoke <IMenuRepository> .Call()); }
public CompanyService() { repositories = Invoke <IRepositoryFactory> .Call(); }
public ILanguageRepository GetLanguageRepository() { return(Invoke <ILanguageRepository> .Call()); }
public IApplicationRepository GetApplicationRepository() { return(Invoke <IApplicationRepository> .Call()); }
public IConfigRepository GetConfigRepository() { return(Invoke <IConfigRepository> .Call()); }
public ICompanyRepository GetCompanyRepository() { return(Invoke <ICompanyRepository> .Call()); }
public ExportController() { service = Invoke <IExcelService> .Call(); }
public IMicroserviceRepository GetMicroserviceRepository() { return(Invoke <IMicroserviceRepository> .Call()); }
public static void SetSessionAsManager(IServiceCollection services) { services.AddCors(config => { var policy = new CorsPolicy(); policy.Headers.Add("*"); policy.Methods.Add("*"); policy.Origins.Add("*"); policy.SupportsCredentials = true; config.AddPolicy("policy", policy); }); services.AddAuthorization(auth => { auth.AddPolicy("Bearer", new AuthorizationPolicyBuilder() .AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme) .RequireAuthenticatedUser().Build()); }); services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(options => { options.TokenValidationParameters = new TokenValidationParameters { //IssuerSigningKey = new RsaSecurityKey(new RSACryptoServiceProvider(2048).ExportParameters(true)), ValidateAudience = false, //ValidAudience = "lemoras.com", ValidateIssuer = false, //ValidIssuer = "onuryasar.org", //ValidateLifetime = true, ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey( Encoding.UTF8.GetBytes("xxx")) }; options.Events = new JwtBearerEvents { OnTokenValidated = ctx => { var mngr = Invoke <ISessionManager> .Call(); StringValues a; if (!ctx.Request.Headers.TryGetValue("Authorization", out a)) { ctx.Response.StatusCode = 401; return(Task.FromCanceled(new System.Threading.CancellationToken(true))); } var token = a[0].Replace("Bearer ", ""); var handler = new JwtSecurityTokenHandler(); var tokenS = handler.ReadToken(token) as JwtSecurityToken; var userSession = new UserSession(); foreach (var item in tokenS.Claims) { switch (item.Type.ToLower().Trim()) { case "username": userSession.UserName = item.Value; break; case "userid": userSession.UserId = item.Value; break; case "applicationinstanceid": userSession.ApplicationInsId = Convert.ToInt32(item.Value); break; case "roleid": userSession.RoleId = Convert.ToInt32(item.Value); break; case "applicationid": userSession.ApplicationId = Convert.ToInt32(item.Value); break; default: break; } } if (string.IsNullOrEmpty(userSession.UserName)) { ctx.Response.StatusCode = 401; return(Task.FromCanceled(new System.Threading.CancellationToken(true))); } UserSession = userSession; return(Task.CompletedTask); }, OnAuthenticationFailed = ctx => { Console.WriteLine("Exception:{0}", ctx.Exception.Message); return(Task.CompletedTask); } }; }); }
public IModuleRepository GetModuleRepository() { return(Invoke <IModuleRepository> .Call()); }
public MappingSettings() { this.mapper = Invoke <IMapper> .Call(); }
public IPageRepository GetPageRepository() { return(Invoke <IPageRepository> .Call()); }
public RoleSetAttribute(string roleSetCommandName) { this.service = Invoke <IWorkContextService> .Call(); this.roleSetCommandName = roleSetCommandName; }
public LimitedApplicationService() : base() { appInsId = Invoke <IWorkContextService> .Call().GetCurrentUserSession().ApplicationInsId; }