question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recommended way to do integration

See original GitHub issue

It seems that I am going in circles, first I thought I would use the headless/rest API but then after thinking about it further it seems maybe not the right approach.

I want to achieve the following:

  • Central place to add/edit/manage pages/sites
  • Have multiple .NET Core sites consume this data

Steps

  1. Create a Piranha CMS with Manager using SQL Server, and ASP.NET Identity (using for satisfied step 1 above), will refer to this site as MyCore
  2. Add a site (default site at this point) called MyCoreSite

Approach 1: Integration

  1. Start a new .NET Core Razor Project - MyConsumer
  2. Add Piranha.AspNetCore nuget package to MyConsumer
  3. Add stuff to startup.cs (not really sure how much stuff is needed given this is only a consumer)
  4. Point the EF to same database as MyCore
  5. Add all copy/paste \Pages\DsiplayTemplates from MyCore to MyConsumer
  6. Add a razor page to MyConsumer that has IApi injected
  7. Get pages using the Api based on which page I want
  8. Render the pages

Approach 2: Headless/REST

  1. Start a new .NET Core Razor Project - MyConsumer
  2. Add Piranha.WebApi to MyCore so enabling headless calls, call .UseApi
  3. Add Piranha.AspNetCore nuget package to MyConsumer, this is done so de-serialization of REST is made easy, otherwise I would have to create custom classes that match the result of the REST Calls
  4. Start making calls to MyCore using REST, render pages which requires a lot of manual work as a lot of stuff is not available that makes it easy to render pages (I assume).

It seems that integration is the way to go but I am not entirely sure.

I wish there was an example of both of these scenarios provided so it is 100% clear on what is required for both scenarios. I am sure a lot of people would find it useful.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tidyuicommented, Dec 15, 2020

@dinukasal If you can’t resolve IApi or IDb you haven’t called services.AddPiranha(..) in your ConfigureServices. Take a look at this page for documentation, or the entire Basics section if you’re new to Piranha. https://piranhacms.org/docs/basics/application-setup

Best regards

0reactions
bbqchickenrobotcommented, Jun 1, 2021

@dinukasal Did you ever get this resolved ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

8.5 Integration Strategies‣ Chapter 8 Techniques ...
(a) Simplify the integrand, if possible. ; (b) See if a “simple” substitution will work. ; (c) Identify the type of integral. ;...
Read more >
Calculus II - Integration Strategy
Simplify the integrand, if possible. This step is very important in the integration process. · See if a “simple” substitution will work.
Read more >
8. Techniques of Integration
1. Substitution · 2. Powers of sine and cosine · 3. Trigonometric Substitutions · 4. Integration by Parts · 5. Rational Functions ·...
Read more >
What's the best way to tell which integration method I ...
The answer for what to do in class is to be able to quickly try a method and identify that it will or...
Read more >
Best way to solve an integral using Integration by parts.
The easiest/quickest way in my opinion to do integration by parts is something called the D-I method. Would highly recommend using it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found