So, I have this method:
internal K GetValue<T, K>(T source, string col) where T : IBaseObject { string table = GetObjectTableName(source.GetType()); DataTable dt = _mbx.Tables[table]; DataRow[] rows = dt.Select("ID = " + source.ID); if (rows.Length == 0) return K; return (K) rows[0][col]; }
I want to be able to return null or some kind of empty value if no rows are found. What is the correct syntax for this?
Jason miesionczek
source share