Skip to content
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

[Feature Request] In v17.3+, We Need a Way to Get Typed from Outside of a 2sxc App #3355

Open
jeremy-farrance opened this issue Apr 23, 2024 · 3 comments

Comments

@jeremy-farrance
Copy link
Sponsor

I'm submitting a

[x] bug report
[x] expected/required feature request

...about

[x] Razor templating
[x] C# code outside a 2sxc App context like Theme (.ascx), Class Libraries (.cs)
[x] other

Current Behavior / Expected Behavior

After making good progress adapting to Typed and recently Strongly Typed 2sxc on our in-development and production projects, I am returning to code we use a few times a year where we need access to either Render the output of a module from the DNN Theme, or get access to Data (just one Content Type) from within a DDR Menu Razor Template.

Most of our code examples are from v13+ using either GetScoped or GetService on IRenderService or IDynamicCodeService as is documented here: Use 2sxc Data, Services or Output in Dnn Themes/Skins and Modules.

This still works, but since we've already adapted related code in the project to at least Typed, switching all the way back to the old stuff is at least frustrating and also concerns us because it seems like we may be forced to do rewrites in the near future once IDynamicCode12 is deprecated. We already have helpers/methods written expecting an ITypedItem to be passed in and rewriting these to be compatible with passing in dynamic is... not fun.

So, we have 2 projects in progress, both are already fully up to date and running DNN v9.13.03 and 2sxc v17.06.03+:

Is there a way "from external" to get at least Typed?

Answering the question above is my immediate need, obviously. But I can't help but think-out-loud...

I experimented with various ways to try to access either IAppTyped or get/instantiate a ServiceKit (ServiceKit16), but I just don't know enough and seem to run into stuff marked internal or other confusions.

It would seem like a long-term benefit to 2sxc's future evolutions if:

  1. The ServiceKit concept had a way to get to the modern equivalents of IRenderService and IDynamicCodeService. Or maybe a fully instantiated .App (.OfApp(7) ?) returning IAppTyped or better. I really don't know what is possible or too much work, but I know my use-cases well.
  2. Then provide a way to get the full/latest ServiceKit from outside, external.

Your environment

  • 2sxc version(s): 16+, 17+
  • Browser: all
  • DNN: all | 9.6.1 | 9.13.03
  • Hosting platform: IIS | any
  • Language: any/all
@jeremy-farrance jeremy-farrance changed the title In v17.3+, We Need a Way to Get Typed from Outside of a 2sxc App [Feature Request] In v17.3+, We Need a Way to Get Typed from Outside of a 2sxc App Apr 23, 2024
@jeremy-farrance
Copy link
Sponsor Author

Is this something we can expect to get done within a few weeks? Months? By the end of the year? Just looking for some guidance so I can better plan whether or not we continue to do things the non-typed old way or table the efforts until this part of 2sxc gets modernized. Thanks in advance!

@iJungleboy
Copy link
Contributor

@jeremy-farrance I have no timeline at all.

Please not that even if we do implement it, to 99% it will be simply typed, so you'll still need .String("Name") because I don't think we will be able to inject the hot-built DLL into that context.

@jeremy-farrance
Copy link
Sponsor Author

jeremy-farrance commented Apr 30, 2024

Yes, I had -no- expectation of Strongly Type. Just hoping for Typed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants