/// <summary> /// 添加记录 /// </summary> #region bool DAO_Add(T entity) public static bool DAO_Add(T entity) { try { ActiveRecordBase <T> .Save(entity); return(true); } catch (Exception ex) { //LogHelper.WriteLog(LogTag + ".DAO_Add(T entity) ", ex); return(false); } }
internal static void SaveInstance(object instance, Controller controller, ArrayList errors, IDictionary prop2Validation) { if (instance is ActiveRecordValidationBase) { ActiveRecordValidationBase instanceBase = instance as ActiveRecordValidationBase; if (!instanceBase.IsValid()) { errors.AddRange(instanceBase.ValidationErrorMessages); prop2Validation = instanceBase.PropertiesValidationErrorMessage; } else { instanceBase.Save(); } } else { ActiveRecordBase instanceBase = instance as ActiveRecordBase; instanceBase.Save(); } }
public static void SaveLater(this ActiveRecordBase record) { RealmServer.IOQueue.AddMessage(() => record.Save()); // leave it as a Lambda Expr to get a complete stacktrace }
public static void SaveLater(this ActiveRecordBase record) { ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() => record.Save())); }