/// <summary> /// Returns the first calculation which has a certain state. /// </summary> /// <param name="stateName">Name of the state.</param> /// <returns></returns> public virtual Calculation GetFirstByState(string stateName) { var state = stateDepot.GetByName(stateName); var calculation = calculationDepot.GetFirstByStateId(state.Id); return(calculation); }
/// <summary> /// Deletes the calculations with status deleting. /// </summary> public void DeleteDeleting() { var stateDeleting = stateDepot.GetByName(State.NameDeleting); if (stateDeleting == null) { return; } var calculation = calculationDepot.GetFirstByStateId(stateDeleting.Id); if (calculation == null) { return; } App.Logger.Info($"Delete calculation {calculation.Id}..."); Delete(calculation.Id); }