I have 2 or more class:
public class AllParam
{
public int Id { get; set; }
public string Data { get; set; }
public string Allarme { get; set; }
}
public class UtentiParam
{
public int Id { get; set; }
public string Utente { get; set; }
public string Psw { get; set; }
public string Livello { get; set; }
}
and I want to read data from my data base with this code:
var list = new List<AllParam>();
using (var db_ = new LiteDatabase(@"C:\HmiImpBroda\DataBase\" + TableToProcess + ".db"))
{
var col = db_.GetCollection<AllParam>(TableToProcess);
foreach (AllParam _id in col.FindAll())
{
list.Add(_id);
}
}
Exist a way to set set AllParam
or CurveParam
in my function from a string? in this way I can use the same code for each type of class without write other code.
Thanks.