我正在使用 LiteDB。客户定义如下:
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string[] Phones { get; set; }
public string[] Cars { get; set; }
}
当我想在数据网格视图中显示我的数据时,只显示前两列,而数据网格视图不显示最后两列是数组。
这是GetAll
private List<Customer> GetAll()
{
var issuesToReturn = new List<Customer>();
try
{
using (var db = new LiteDatabase(Constants.ConnectionString))
{
var issues = db.GetCollection<Customer>("customers");
foreach (Customer issueItem in issues.FindAll())
{
issuesToReturn.Add(issueItem);
}
}
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
return issuesToReturn;
}