/// <summary>发布</summary> /// <returns></returns> public Int32 Publish() { ConfigHistory.Add(Id, "Publish", true, this.ToJson()); var rs = 0; using var tran = Meta.CreateTrans(); try { Version = NextVersion; PublishTime = DateTime.MinValue; var list = ConfigData.FindAllByApp(Id); rs += ConfigData.Publish(list, Version); rs += Update(); tran.Commit(); } catch (Exception ex) { ConfigHistory.Add(Id, "Publish", false, ex.GetMessage()); throw; } return(rs); }
/// <summary>添加</summary> /// <returns></returns> protected override Int32 OnInsert() { var rs = base.OnInsert(); ConfigHistory.Add(AppId, "Insert", true, this.ToJson()); return(rs); }
/// <summary>添加</summary> /// <returns></returns> protected override Int32 OnInsert() { var rs = base.OnInsert(); ConfigHistory.Add(Id, "Insert", null, this.ToJson(), 0); return(rs); }
/// <summary>更新</summary> /// <returns></returns> protected override Int32 OnUpdate() { if (HasDirty) { ConfigHistory.Add(AppId, "Update", true, Dirtys.ToDictionary(e => e, e => this[e]).ToJson()); } return(base.OnUpdate()); }
/// <summary>发布</summary> /// <returns></returns> public Int32 Publish() { ConfigHistory.Add(Id, "Publish", true, this.ToJson()); Version = NextVersion; PublishTime = DateTime.MinValue; return(Update()); }
/// <summary>更新</summary> /// <returns></returns> protected override Int32 OnUpdate() { var cfg = Find(_.Id == Id); if (cfg != null) { var ns = new[] { __.Key, __.AppId, __.Scope, __.Value, __.Enable }; foreach (var item in ns) { if (Dirtys[item]) { ConfigHistory.Add(Id, "Update", item, cfg[item] + "", 0); } } } return(base.OnUpdate()); }
/// <summary>删除</summary> /// <returns></returns> protected override Int32 OnDelete() { ConfigHistory.Add(AppId, "Delete", true, this.ToJson()); return(base.OnDelete()); }
/// <summary>删除</summary> /// <returns></returns> protected override Int32 OnDelete() { ConfigHistory.Add(Id, "Delete", null, this.ToJson(), 0); return(base.OnDelete()); }