Open angtianqiang opened 4 years ago
One more problem:
non-backing fields from previous versions of commands can also flow between clients and servers, and the new version seems to require backing fields.
[Serializable]
public class ClearCacheCommand : CommandBase
protected override void DataPortal_Execute()
{
Helpers.CacheHelper.RemoveAllCache(CacheKey);
}
//bill status
public static void ClearCache(string cacheKey)
{
Helpers.CacheHelper.RemoveAllCache(cacheKey);
var cmd = new ClearCacheCommand() { CacheKey = cacheKey };
cmd = DataPortal.Execute<ClearCacheCommand>(cmd);
return;
}
}
}
Your result property is not a Csla managed property; it should be:
public static readonly PropertyInfo<bool> ResultProperty = RegisterProperty<bool>(nameof(Result));
public bool Result {
get => ReadProperty(ResultProperty);
private set => LoadProperty(ResultProperty, value);
}
using normal C# properties has not been recommended for some time now; its possible Csla 5 no longer supports serialization of normal C# properties. That's no a bug if that's the case, its deliberate, and the only solution is to stay on csla 4 or move to managed properties.
Also it seems like your static factory method should be Task<bool>
if you want to return the bool result.
public static class MyCommands { public static async Task DoExampleAsync(...)
{
var cmd = new ExampleCommand(...);
}
The above code works well in 4.6, but cannot work after upgrading to 5.0.1. What is the recommended usage
Version and Platform CSLA version: 5.0.1 OS: Windows, Platform: WPF