public async Task <CustomStateDetail> GetCustomUnitStateAsync(UnitState state) { if (state.State <= 25) { var detail = new CustomStateDetail(); detail.ButtonText = state.GetStatusText(); detail.ButtonColor = state.GetStatusCss(); if (string.IsNullOrWhiteSpace(detail.ButtonColor)) { detail.ButtonColor = "label-default"; } return(detail); } else { var stateDetail = await GetCustomDetailForDepartmentAsync(state.Unit.DepartmentId, state.State); return(stateDetail); } }