public static EntityData GetUnitOnlyHasUserByParent(string parentCode) { EntityData data2; try { UnitStrategyBuilder builder = new UnitStrategyBuilder(); builder.AddStrategy(new Strategy(UnitStrategyName.ParentUnitCode, parentCode)); string queryString = builder.BuildQueryChildCountOnlyHasUserString() + builder.GetDefaultOrder(); QueryAgent agent = new QueryAgent(); EntityData data = agent.FillEntityData("Unit", queryString); agent.Dispose(); data2 = data; } catch (Exception exception) { throw exception; } return(data2); }