Telerik中基于任务的异步模式支持

时间:2017-02-04 08:55:59

标签: c# telerik

我想知道telerik是否有任何微笑模式?

https://entityframework.codeplex.com/wikipage?title=Task-based%20Asynchronous%20Pattern%20support%20in%20EF.#ThreadSafety

await query.ForEachAsync(employee =>
{
     Console.WriteLine(employee);
});

// Modify
var product1 = await context.Products.FindAsync(1);
product1.Name= "Smarties";

// Delete
var product2 = awaitcontext.Products.FindAsync(2);
context.Products.Remove(product2);

// Add
var product3 = new Product() { Name = "Branston Pickle" };
context.Products.Add(product3);

// Save
int savedCount = await context.SaveChangesAsync();

Console.WriteLine("Affected entities: " + savedCount); // 3

//Raw sql Queries
var categories = await context.Database.SqlQuery<Category>(
"select * from Categories").ToListAsync();

1 个答案:

答案 0 :(得分:0)

Telerik使用此模式但存在此问题。