private TEntity GetSingleValue(object modelValue) { if (modelValue == null) { return(null); } Guid businessId; int id; TEntity entity = null; if (Guid.TryParse(modelValue.ToString(), out businessId)) { /*Domain-Entity wird anhand der BusinessId gebunden*/ entity = _dao.GetByBusinessId(businessId); } else if (int.TryParse(modelValue.ToString(), out id)) { /*Domain-Entity wird anhand der Id gebunden*/ entity = _dao.GetByPrimaryKey(id); } return(entity); }