|
Post by burnout on Feb 12, 2019 10:45:43 GMT
Hello I am currently trying to make a wrapper that my classes can use to work with the db. I have problems with this line
public static T SelectEntry<T>(int id) where T : TableBaseData {
string SQL = "SELECT * FROM " + ( typeof ( T ).FullName ) + " WHERE Id = " + id.ToString ();
return App.AppManager.Instance._dbManager.Query<T> ( SQL )[0];
} is there a way to give T to the query function. Right now i balck out and cant think of it XD
The _dbManager is the required instance of the manager as you might have guessed.
|
|
|
Post by burnout on Feb 12, 2019 10:59:58 GMT
public static T SelectEntry<T>(int id) where T : TableBaseData, new() { string SQL = "SELECT * FROM " + ( typeof ( T ).FullName ) + " WHERE Id = " + id.ToString (); return App.AppManager.Instance._dbManager.Query<T> ( SQL )[0]; }
works like this. Sorry for creating a thread.
|
|
|
Post by echo17 on Feb 12, 2019 14:15:25 GMT
No worries, thank you for posting your solution!
|
|