public static bool Remove <T>(T albianObject) where T : class, IAlbianObject { if (null == albianObject) { throw new ArgumentNullException("albianObject"); } TaskBuilder builder = new TaskBuilder(); ITask task = builder.BuildRemoveTask(albianObject); ITransactionClusterScope tran = new TransactionClusterScope(); return(tran.Execute(task)); }
public static bool Create <T>(T albianObject) where T : class, IAlbianObject { if (null == albianObject) { throw new ArgumentNullException("albianObject"); } TaskBuilder builder = new TaskBuilder(); ITask task = builder.BuildCreateTask(albianObject); ITransactionClusterScope tran = new TransactionClusterScope(); bool isSuccess = tran.Execute(task); if (!isSuccess) { return(isSuccess); } ResultCache.CachingObject(albianObject); return(isSuccess); }
public static bool Modify <T>(IList <T> albianObjects) where T : class, IAlbianObject { if (null == albianObjects) { throw new ArgumentNullException("albianObjects"); } if (0 == albianObjects.Count) { throw new ArgumentException("albianObject count is 0."); } TaskBuilder builder = new TaskBuilder(); ITask task = builder.BuildModifyTask(albianObjects); ITransactionClusterScope tran = new TransactionClusterScope(); bool isSuccess = tran.Execute(task); if (!isSuccess) { return(isSuccess); } ResultCache.CachingObjects(albianObjects); return(isSuccess); }