Open Chicagoan2016 opened 6 years ago
No, because a static value can't be safely serialized between client and server. That value is shared by everything in the entire AppDomain, so changes made to it need to be intentional.
If you are trying to have a global value that should be available on client and server, that value should be maintained in ApplicationContext.ClientContext or GlobalContext.
Thank you @rockfordlhotka , I am going to reread about ClientContext and Globalcontext : )
kind regards
@rockfordlhotka , we have used 'const strings' in static classes and these const strings store hard coded values, we did that to avoid remembering those hard coded values. Should we stop doing this while using Csla? Thanks and Regards
As I'm sure you know, global values of any sort are considered an anti-pattern in general terms.
I'm just describing why CSLA doesn't have any construct around them. You can surely have them in your classes, but CSLA will ignore them, because they can't be safely serialized or managed by CSLA.
can't thank you enough @rockfordlhotka .
Should we go ahead and change static classes and their properties ( to store hard coded strings) to something based on Csla BusinessBase? We have used those classes to store default values for business properties in our business objects. I hope we didn't get ourselves in a mess : )
Hi All, We can declare different property types in Csla like Read/Write Properties, Child reference properties etc. I was wondering if there is a way to declare a Csla style static property in an object?
kind regards
Version and Platform CSLA version: 4.7.100 OS: Windows, Linux, iOS, Android, etc. Platform: WinForms, WPF, ASP.NET Core, MVC, Xamarin, etc.