本文整理汇总了C#中Table.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Table.ToList方法的具体用法?C# Table.ToList怎么用?C# Table.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table.ToList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SqlOrderDisplayRepository
public SqlOrderDisplayRepository(string connectionString)
{
ordersTable = (new DataContext(connectionString)).GetTable<Order>();
orderItemsTable = (new DataContext(connectionString)).GetTable<OrderItem>();
deliveryDetailsTable = (new DataContext(connectionString)).GetTable<DeliveryDetails>();
ListOrder = ordersTable.ToList();
ListOrderItem = orderItemsTable.ToList();
ListDeliveryDetail = deliveryDetailsTable.ToList();
}
示例2: Initialise
public static void Initialise()
{
ConnectionString = @"Data Source=.\RECORNECT;Initial Catalog=JeroenDB;Integrated Security=True";
#if DEBUG
ConnectionString = ConnectionString.Replace("JeroenDB", "JeroenTest");
#endif
_context = new DataContext(ConnectionString);
try
{
_table = _context.GetTable<Registratie>();
DbEmpty = _table.ToList().Count == 0;
IsConnected = true;
}
catch (Exception e)
{
MessageBox.Show($"Geen verbinding met database: {e.Message}", @"Geen verbinding!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例3: NewsFeedsViewModel_PropertyChanged
void NewsFeedsViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "BaseIntelligence")
{
feedsInTable = (Table<TableModels.NewsFeedTable>)BaseIntelligence.CoreIntelligence.RepositoryIntelligence.LoadTable(typeof(TableModels.NewsFeedTable));
feedsInTable.ToList().ForEach(x => MenuItems.Add(new EasySocial.FrameWork.Models.SubMenuItem()
{
OpenCommand = new EasySocial.FrameWork.Commands.BaseCommand(new Action<object>(openFeed)),
CommandParam = x,
Title = x.Name
}));
}
}