sqlite - C# Generics on Auto-Implemented Property Classes -
 I have created a property class representing the table schema of my SQLite database, each attribute in the class becomes an attribute in the database. .    Now, to get some data from a table,    I would not want to type type-specific methods, well this is a tedious task. I want to make a reusable method that can retrieve data on any table using generic implementation. How can I get it?     Edit  I'm working on the Windows Phone 8 platform.       This should work for you.   
 public zero GetPersonList () {list & lt; TblPerson & gt; LstTemp = dbConn.Table & lt; TblPerson & gt; (). ToList & lt; TblPerson & gt; (); // some 20 lines code here}    
 Public listing & lt; T & gt; GetItems & lt; T & gt; () {Return dbConn.Table & lt; T & gt; (). ToList & lt; T & gt; (); }    
 
Comments
Post a Comment