private T Fun <T, T2>(Func <T2, T> function, T2 Id) { try { sqLiteHelper = new SqLiteHelper("data source=mydb2.db"); return(function.Invoke(Id)); } finally { sqLiteHelper.CloseConnection(); } }
private void Act(Action act) { try { sqLiteHelper = new SqLiteHelper("data source=mydb2.db"); act.Invoke(); } finally { sqLiteHelper.CloseConnection(); } }