New to C#, what in the world does this code do?

I am currently going through a SQLite implementation of a project I'm working on. I can understand the goal of the method, but what in the world is new() doing there?

public virtual T GetItem<T> (IDatabaseObject iDbObj) where T : IDatabaseObject, new() { lock (database) { List<T> result = database.Query<T> ("SELECT * FROM "+iDbObj.tblName+" WHERE "+iDbObj.KeyName+" = ?", iDbObj.Key).ToList (); return result.FirstOrDefault (); } } 

by vrwim via /r/csharp

Leave a Reply