public async Task InvokeAsync(HttpContext context, IServicePack servicePack, Common2DBContext common2DBContext, PersonalDBShardManager.PersonalShard001 personalShard001, PersonalDBShardManager.PersonalShard002 personalShard002, PersonalDBShardManager.PersonalShard003 personalShard003, PersonalDBShardManager.PersonalShard004 personalShard004, PersonalDBShardManager.PersonalShard005 personalShard005, PersonalDBShardManager.PersonalShard006 personalShard006, PersonalDBShardManager.PersonalShard007 personalShard007, PersonalDBShardManager.PersonalShard008 personalShard008, ILogObj logObj) { servicePack.Common2DBContext = common2DBContext; servicePack.PersonalDBShardManager = new PersonalDBShardManager( personalShard001, personalShard002, personalShard003, personalShard004, personalShard005, personalShard006, personalShard007, personalShard008 ); //log servicePack.Log = logObj; await _next(context); Logger.Logging(logObj); }
public GdprService(IServicePack servicePack) { PDBSM = servicePack.PersonalDBShardManager; Common1DB = servicePack.Common1DBContext; Common2DB = servicePack.Common2DBContext; Common3DB = servicePack.Common3DBContext; }
public async Task InvokeAsync(HttpContext context, IServicePack servicePack, Common1DBContext common1DBContext, Common2DBContext common2DBContext, Common3DBContext common3DBContext, PersonalDBShardManager.PersonalShard001 personalShard001, PersonalDBShardManager.PersonalShard002 personalShard002, PersonalDBShardManager.PersonalShard003 personalShard003, PersonalDBShardManager.PersonalShard004 personalShard004, PersonalDBShardManager.PersonalShard005 personalShard005, PersonalDBShardManager.PersonalShard006 personalShard006, PersonalDBShardManager.PersonalShard007 personalShard007, PersonalDBShardManager.PersonalShard008 personalShard008, ILogObj logObj) { //masterdata servicePack.MasterData = MasterDataLoader.LatestMasterData; //db context servicePack.Common1DBContext = common1DBContext; servicePack.Common2DBContext = common2DBContext; servicePack.Common3DBContext = common3DBContext; servicePack.PersonalDBShardManager = new PersonalDBShardManager( personalShard001, personalShard002, personalShard003, personalShard004, personalShard005, personalShard006, personalShard007, personalShard008 ); //log servicePack.Log = logObj; var path = context.Request.Path.ToString(); if (path.StartsWith("/api/")) { path = path.Substring("/api/".Length); path = path.Replace('/', '_').ToLower(); ProtocolModels.ProtocolCode protocolcode; if (!Enum.TryParse(path, out protocolcode)) { context.Response.StatusCode = (int)HttpStatusCode.Gone; return; } servicePack.ProtocolCode = protocolcode; } await _next(context); Logger.Logging(logObj); }
public static async Task LoadAsync(Common2DBContext db) { var rec = await db.GenericDatas .Where(r => r.type == GenericData.Type.TranslationTablePath) .FirstOrDefaultAsync(); if (rec == null) { return; } var requester = new DummyRequester(); var res = await requester.GetAsync(rec.data1); if (res.StatusCode != System.Net.HttpStatusCode.OK) { return; } SrcPath = rec.data1; RawData = res.Payload; }
public BaseController(IServicePack servicePack) { PDBSM = servicePack.PersonalDBShardManager; Common2DB = servicePack.Common2DBContext; }
public static async Task <PlayerBasicInformation> ByPlayerName(string playerName, PersonalDBShardManager pdbsm, Common2DBContext common2DB) { var rec = await common2DB.PlayerNames.FindAsync(playerName); if (rec == null) { return(null); } var db = pdbsm.PersonalDBContext(rec.playerId); return(await db.PlayerBasicInformations.FindAsync(rec.playerId)); }