Any performance improvements using PLinq in DomainService query operations
Can i expect any performance improvements if i use the .AsParallel() extension in the query operations of my domain service. The DomainService uses a Repository (EntityFramework) to query data and to build up ViewModels for the client that are returned by the query operations.
Here´s a simple query operation in my DomainService:
[Query]
public IQueryable<ProductViewModel> GetProductSet() {
var products = from product in _productRepository.Query()
select product;
return (from product in products.ToList()
select new ProductViewModel() { Product = product}).AsQueryable();
}
If i can speed up things using PLinq, where should i add the .AsParallel() call?
Here
_productRepository.Query().AsParallel();
There
products.AsPa开发者_StackOverflow中文版rallel().ToList()
or there
product.ToList().AsParallel()
精彩评论