|
|
@ -25,12 +25,25 @@ namespace EGFramework.Examples.Test{ |
|
|
|
csvSave.InitSaveFile("SaveData/TestCsv.csv"); |
|
|
|
csvSave.InitSaveFile("SaveData/TestCsv.csv"); |
|
|
|
// Customer testData = csvSave.GetData<Customer>("",1); |
|
|
|
// Customer testData = csvSave.GetData<Customer>("",1); |
|
|
|
// GD.Print("Name = "+testData.Name +" || ID = "+testData.Id); |
|
|
|
// GD.Print("Name = "+testData.Name +" || ID = "+testData.Id); |
|
|
|
Customer testData = new Customer(){ |
|
|
|
// Customer testData = new Customer(){ |
|
|
|
Id = 1008, |
|
|
|
// Id = 1008, |
|
|
|
Name = "AddDataDefault", |
|
|
|
// Name = "AddDataDefault", |
|
|
|
IsActive = true |
|
|
|
// IsActive = true |
|
|
|
}; |
|
|
|
// }; |
|
|
|
csvSave.SetData("",testData,2); |
|
|
|
// 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)); |
|
|
|
// GD.Print(typeof(Customer)); |
|
|
|
// Type type = typeof(Customer); |
|
|
|
// Type type = typeof(Customer); |
|
|
|