|
|
|
@ -25,12 +25,25 @@ namespace EGFramework.Examples.Test{
@@ -25,12 +25,25 @@ namespace EGFramework.Examples.Test{
|
|
|
|
|
csvSave.InitSaveFile("SaveData/TestCsv.csv"); |
|
|
|
|
// Customer testData = csvSave.GetData<Customer>("",1); |
|
|
|
|
// GD.Print("Name = "+testData.Name +" || ID = "+testData.Id); |
|
|
|
|
Customer testData = new Customer(){ |
|
|
|
|
Id = 1008, |
|
|
|
|
Name = "AddDataDefault", |
|
|
|
|
IsActive = true |
|
|
|
|
}; |
|
|
|
|
csvSave.SetData("",testData,2); |
|
|
|
|
// Customer testData = new Customer(){ |
|
|
|
|
// Id = 1008, |
|
|
|
|
// Name = "AddDataDefault", |
|
|
|
|
// IsActive = true |
|
|
|
|
// }; |
|
|
|
|
// csvSave.SetData("",testData,2) |
|
|
|
|
|
|
|
|
|
IEnumerable<Customer> allResult = csvSave.GetAll<Customer>(""); |
|
|
|
|
GD.Print("Get result " + allResult.Count()); |
|
|
|
|
foreach(Customer customer in allResult){ |
|
|
|
|
GD.Print(customer.Id +"|" + customer.Name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// System.Linq.Expressions.Expression<Func<Customer, bool>> expr = i => i.Id < 5; |
|
|
|
|
// IEnumerable<Customer> linqResult = csvSave.FindData<Customer>("",expr); |
|
|
|
|
// GD.Print("Find result " + linqResult.Count()); |
|
|
|
|
// foreach(Customer customer in linqResult){ |
|
|
|
|
// GD.Print(customer.Name); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// GD.Print(typeof(Customer)); |
|
|
|
|
// Type type = typeof(Customer); |
|
|
|
|