void NotifyCacheServer <TItem>(TItem newObj) where TItem : IModel { if (!OnUpdateNotifyCacheServer) { return; } var client = CacheServerSetting.GetCurrentClient(typeof(TItem)); if (client != null) { client.Update(newObj); } }
/// <summary> /// 通知缓存服务器 /// </summary> /// <typeparam name="TItem"></typeparam> /// <param name="newObj"></param> void NotifyCacheServer <TItem>(TItem newObj) where TItem : IModel { if (!OnUpdateNotifyCacheServer) { return; } System.Threading.Tasks.Task.Run(() => { var client = CacheServerSetting.GetCurrentClient(typeof(TItem)); if (client != null) { client.Update(newObj); } }); }
/// <summary> /// 通知缓存服务器 /// </summary> /// <typeparam name="TModel"></typeparam> /// <param name="newObj"></param> void NotifyCacheServer <TModel>(TModel newObj) where TModel : IModel { if (DataBaseArchitecture == CRL.DataBaseArchitecture.NotRelation) { //非关系型没有缓存 return; } if (!OnUpdateNotifyCacheServer) { return; } var client = CacheServerSetting.GetCurrentClient(typeof(TModel)); if (client != null) { client.Update(newObj); } }