MarimerLLC / cslaforum

Discussion forum for CSLA .NET
https://cslanet.com
Other
31 stars 6 forks source link

CSLA 4.6.1 breaking changes? #47

Open halloween8 opened 9 years ago

halloween8 commented 9 years ago

That class and others similar to this one (which was adapted from the MyVote Las Vegas 2013 project for Microsoft.Unity) does not work anymore, it asks me to implement System.IClonable.Clone() As something changed related to that?

namespace Dealerlive.CSLA.Core { using System;

using Csla;

using Dealerlive.Core;
using Dealerlive.CSLA.Core.Contracts;

if !NETFX_CORE && !WINDOWS_PHONE

[System.Serializable]

else

[Csla.Serialization.Serializable]

endif

public abstract class ReadOnlyBaseCore<T> : ReadOnlyBase<T>, IReadOnlyBaseCore where T : ReadOnlyBaseCore<T> 
{
    protected ReadOnlyBaseCore()
        : base() { }

if !NETFX_CORE && !WINDOWS_PHONE

    protected override void Child_OnDataPortalInvoke(DataPortalEventArgs e) {
        base.Child_OnDataPortalInvoke(e);
                  IoC.BuildUpProperties(this);
    }

    protected override void Child_OnDataPortalException(DataPortalEventArgs e, Exception ex) {
        base.Child_OnDataPortalException(e, ex);
        //this._scope.Dispose();
    }

    protected override void Child_OnDataPortalInvokeComplete(DataPortalEventArgs e) {
        base.Child_OnDataPortalInvokeComplete(e);
        //this._scope.Dispose();
    }

    protected override void DataPortal_OnDataPortalInvoke(DataPortalEventArgs e) {
        base.DataPortal_OnDataPortalInvoke(e);
        IoC.BuildUpProperties(this);
    }

    protected override void DataPortal_OnDataPortalException(DataPortalEventArgs e, Exception ex) {
        base.DataPortal_OnDataPortalException(e, ex);

    }

    protected override void DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs e) {
        base.DataPortal_OnDataPortalInvokeComplete(e);

    }

endif

}

}

Thanks,

rockfordlhotka commented 9 years ago

A lot has changed in 2 years :smile:

I believe what you are encountering is a change made in CSLA 4.5.x where all the base classes were enhanced to implement a consistent top-level interface to enable better support for testing scenarios. This top-level set of interfaces aggregates all the interfaces implemented by BusinessBase (for example) into a single interface that can be used for things like mocking.

halloween8 commented 9 years ago

But I've been using it for the last 2 years and updated CSLA up to 4.5.701 without incident, but as soon as i tried to update to 4.6.100 It gives me this. so what do I do :-)

rockfordlhotka commented 9 years ago

What is it that asks you to implement ICloneable? The compiler? Or something at runtime?

Also, as a note for 4.6.200, Csla.Serialization.Serializable is replaced by System.Serializable.

JasonBock commented 9 years ago

I believe "ICloneable" was "accidentally" added to the Csla namespace:

https://github.com/MarimerLLC/csla/commits/master/Source/Csla.Shared/ICloneable.cs

Now, WHY this was added...I'm not sure - @rockfordlhotka any ideas?

rockfordlhotka commented 9 years ago

Thank you @JasonBock, that helps - clarifies that this is a bug in 4.6.100 caused when I merged all the various platform codebases into Csla.Shared.

halloween8 commented 9 years ago

Another one bites the dust :-D