-
-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infolist Dataportal Issue #4411
Comments
Could you provide the stack trace of the exception? Side note: why are you casting to dataportal? That would break if we decide to change the implementation. Using the interface is recommended. |
Hi Stefan Thanks for the quick reply! The stack trace isn't showing anything useful:
Thanks for your recommendation on using the interface - I don't know how I would do that as at some point I need a concrete instance of the proper dataportal don't I? I am trying to preserve the classic methodology of CSLA encapsulating everything in each business object, hence the approach I am trying here. It's strange that it works fine for a Switchable object but not for the infolist. I am going to rty an erditable list next to see if that works. |
Hi Stefan. I found out what was causing the exception - though it is a mystery as to why. I had this method in my business object:
This is the method that causes the exception. What is VERY strange is that I never call it in my code, so it must be called behind-the-scenes by CSLA maybe? Also very strange is that it does not appear in the call-stack at all for the exception, yet commenting it out cured the exception: Any thoughts? |
You have to get rid of the |
That's true - you can't use or access a DI service instance from a static method. Well, unless you are
This only works in something like WinForms or WPF, and only if you have a remote data portal app server. |
I'm using CSLA 8.
The following works great fetching an object:
The following fails with the Exception:
Message=Object of type 'Csla.Rules.AddObjectAuthorizationRulesContext' cannot be converted to type 'Csla.ApplicationContext'.
Any thoughts?
The text was updated successfully, but these errors were encountered: