Ticket T1282760
Visible to All Users

Re: XAF Blazor - OnSaving is executed twice

created a day ago

Hello,
I couldn't understand why the OnSaving method is triggered twice in the DevExpress XAF Web & Win .NET Core 24.2.5 project. I am sending you the project as an example. It is a very basic starter project with no additional development. I don't recall having this issue in previous versions.
How can I fix this problem? Could you help me with this?

XafOnsavingTwice.jpg

Code
using DevExpress.ExpressApp.DC; using DevExpress.Persistent.Base; using DevExpress.Xpo; namespace DXApplication4.Module.BusinessObjects { [DefaultClassOptions] public class DomainObject : XPObject { public DomainObject(Session session) : base(session) { } public override void AfterConstruction() { base.AfterConstruction(); } private string _PersistentProperty; [XafDisplayName("My display name"), ToolTip("My hint message")] public string PersistentProperty { get { return _PersistentProperty; } set { SetPropertyValue(nameof(PersistentProperty), ref _PersistentProperty, value); } } protected override void OnSaving() { base.OnSaving(); } } }

Answers approved by DevExpress Support

created 5 hours ago

Hello Murat,

Thank you for the sample project, screenshot and code sample.

I confirm that the OnSaving method being called multiple times during a single save operation is expected and by design. We described this in the following help topic: XPO Best Practices > Custom Logic in OnSaving and OnDeleting Methods. Please refer to it for our recommendation regarding custom logic in this method.

Best regards,
Herman

    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.