[DevExpress Support Team: CLONED FROM Q558707: How do I prefetch related details data to increase performance for calculated fields]
Is there any plan to provide an universal way to "bind" childs and parent objects like EF do, in XPO, with some way to replace the base query for a specific model?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Matthieu,
I am afraid it is difficult to provide any comments on this without understanding your current problem or situation. If you currently have specific performance or other problems with how XPO behaves, please provide us with a debuggable sample project and other supporting information so that we can replicate and understand your current issue. With that specific information, we will be able to provide you with the best technical solutions and probably comment more on our plans in this regard. Thanks.
I followed the guidelines in Q558707 to improve the initial load time of my grid with the following controller :
using Borea.Module.BusinessObjects.Borea; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Xpo; using System.Collections; using System.Collections.Generic; using System.ComponentModel; namespace Borea.Module.Win.Controllers { public partial class ProductPrefetchController : ViewController<ListView> { public ProductPrefetchController() { TargetObjectType = typeof(Product); } protected override void OnActivated() { base.OnActivated(); PrefetchCollections(); } void PrefetchCollections() { var session = ((XPObjectSpace)ObjectSpace).Session; var toPrefetch = View.CollectionSource.Collection as IEnumerable; if (View.CollectionSource.Collection is IListSource list) { var temp = new List<object>(); foreach (var item in list.GetList()) { temp.Add(item); } toPrefetch = temp; } if (toPrefetch != null) { session.PreFetch(session.GetClassInfo(View.ObjectTypeInfo.Type), toPrefetch, "InventoryOperations"); } } } }
But as you say in Q558707, when the user hits the refresh button, the delay comes back, as all the details are requested individually.
Thanks for the clarification. I'm afraid we don't have a universal solution for such scenarios. If you need help with optimizing loading performance in your application, please provide us with a sample project demonstrating your specific scenario. We will do our best to find a solution.