private void SaveConfig(IDataConfig config) { string key = savePrefix + config.ToString(); var json = JsonUtility.ToJson(config); PlayerPrefs.SetString(key, json); }
public LanguageMap(IDataConfig config) { ToTable(config.TablePrefix + "Languages", config.TableSchema); HasKey(e => e.CultureCode); Property(e => e.CultureCode) .HasColumnType(DbConst.Varchar) .HasMaxLength(64); Property(e => e.LanguageCode) .HasColumnType(DbConst.Varchar) .HasMaxLength(64); Property(e => e.Name) .HasMaxLength(255); Property(e => e.LocalizedName) .HasMaxLength(255); Property(e => e.UpdatedOn) .IsRequired(); Property(e => e.CreatedOn) .IsRequired(); HasRequired(a => a.CreatedBy) .WithMany() .HasForeignKey(u => u.CreatedByUserId) .WillCascadeOnDelete(false); HasRequired(a => a.UpdatedBy) .WithMany() .HasForeignKey(u => u.UpdatedByUserId) .WillCascadeOnDelete(false); }
public LocalizationMap(IDataConfig config) { ToTable(config.TablePrefix + "Localization", config.TableSchema); HasKey(e => e.Id); Property(e => e.Code) .HasMaxLength(200) .IsRequired() .HasColumnAnnotation( IndexAnnotation.AnnotationName, new IndexAnnotation(new IndexAttribute(config.TablePrefix + "UX_Localization_Code_Context_CultureCode", 1) { IsUnique = true })); Property(e => e.Context) .HasMaxLength(200) .HasColumnAnnotation( IndexAnnotation.AnnotationName, new IndexAnnotation(new IndexAttribute(config.TablePrefix + "UX_Localization_Code_Context_CultureCode", 2) { IsUnique = true })); Property(e => e.CultureCode) .HasColumnAnnotation( IndexAnnotation.AnnotationName, new IndexAnnotation(new IndexAttribute(config.TablePrefix + "UX_Localization_Code_Context_CultureCode", 3) { IsUnique = true })); Property(e => e.Description) .HasMaxLength(255); }
//public void PreLoad() //{ // Load<HeroDataConfig>(); // Load<ItemDataConfig>(); // Load<MonsterDataConfig>(); //} public void Load <T>() where T : IDataConfig { //todo 改为异步&加密 Type t = typeof(T); string path = GameConstants.AssetBundlePath + "configs/tabledata"; AssetBundle ab = AssetBundleSys.Instance.LoadAssetBundleInStreaming(path); TextAsset ta = ab.LoadAsset <TextAsset>(t.Name + ".json"); //if (File.Exists("Assets/"+resPath)) //{ //string s = Resources.Load<TextAsset>(resPath).text; IDataConfig resDataConfig = LitJson.JsonMapper.ToObject <T>(ta.text); IList dataList = resDataConfig.GetDataInfoList(); Dictionary <int, BaseDataInfo> tableData = new Dictionary <int, BaseDataInfo>(); foreach (BaseDataInfo dataDetail in dataList) { FieldInfo idFieldinfo = typeof(BaseDataInfo).GetField("Id"); int key = (int)idFieldinfo.GetValue(dataDetail); tableData.Add(key, dataDetail); } _dataConfigs.Add(typeof(T), tableData); //} //else //{ // throw new FileNotFoundException("Don't Find Type Res named " + resPath); //} }
public DbVersionMap(IDataConfig config) { ToTable(config.TablePrefix + "Schemas", config.TableSchema); HasKey(e => e.Version); Property(e => e.Version) .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); Property(e => e.Name) .HasMaxLength(255); }
public UserMap(IDataConfig config) { ToTable(config.TablePrefix + "Users", config.TableSchema); HasKey(e => e.Id); Property(e => e.Username) .HasColumnType(DbConst.Varchar) .HasMaxLength(32) .IsRequired(); Property(e => e.Firstname) .HasMaxLength(32) .IsRequired(); Property(e => e.Lastname) .HasMaxLength(32) .IsRequired(); Property(e => e.Password) .HasColumnType(DbConst.Varbinary) .HasMaxLength(128) .IsRequired(); Property(e => e.Salt) .HasColumnType(DbConst.Varbinary) .HasMaxLength(128) .IsRequired(); Property(e => e.Email) .HasColumnType(DbConst.Varchar) .HasMaxLength(255) .IsRequired(); Property(e => e.CreatedOn) .IsRequired(); Property(e => e.UpdatedOn) .IsRequired(); HasRequired(p => p.CreatedBy) .WithMany() .HasForeignKey(s => s.CreatedByUserId); Property(e => e.CreatedByUserId) .IsRequired(); HasRequired(p => p.UpdatedBy) .WithMany() .HasForeignKey(s => s.UpdatedByUserId); Property(e => e.UpdatedByUserId) .IsRequired(); }
public DbRepository(IDataConfig dataConfig) : base("name=" + dataConfig.KeyForConnectionString) { _dataConfig = dataConfig; if (!_isInitialized) { lock (InitializationLock) { if (!_isInitialized) { Database.SetInitializer(new MigrateDatabaseToLatestVersion <DbRepository, DbMigrationsConfig>()); _isInitialized = true; } } } }
public MerchantMap(IDataConfig config) { ToTable(config.TablePrefix + "Merchants", config.TableSchema); HasKey(e => e.Id); Property(e => e.Name) .HasMaxLength(255) .IsRequired(); Property(e => e.Description).HasMaxLength(255); Property(e => e.Status) .IsRequired(); Property(e => e.Description) .HasColumnType(DbConst.Varchar) .HasMaxLength(255) .IsRequired(); Property(e => e.UpdatedOn) .IsRequired(); Property(e => e.CreatedOn) .IsRequired(); HasRequired(a => a.CreatedBy) .WithMany() .HasForeignKey(u => u.CreatedByUserId) .WillCascadeOnDelete(false); HasRequired(a => a.UpdatedBy) .WithMany() .HasForeignKey(u => u.UpdatedByUserId) .WillCascadeOnDelete(false); }
//[Obsolete("DataBase create method is off!")] public EFRepositoryProvider(IServiceProvider provider) { m_service_provider = provider; m_data_config = provider.GetService(typeof(IDataConfig)) as IDataConfig; Database.EnsureCreated(); }
public ConfigSingle(IDataConfig config) : base(config) { }
public ReCheckReviewSvc(IDataConfig dataConfig) { this._Db = dataConfig; }
public DataSvc(IDataConfig config) { _db = config; }
public MyShopSvc(IDataConfig data) { this._db = data; }
public DailyCheckSvc(IDataConfig DB) { this.DB = DB; }
public MerchantSvc(IDataConfig dataConfig) { this._Db = dataConfig; }
public UsersSvc(IDataConfig config) { this._db = config; }
public OrderSvc(IDataConfig config, IWeChatPaySingle paySingle) : base(config) { _pay = paySingle; }
public RecheckSvc(IDataConfig DB) { this.DB = DB; }