PiranhaCMS / piranha.core

Piranha CMS is the friendly editor-focused CMS for .NET that can be used both as an integrated CMS or as a headless API.
http://piranhacms.org
MIT License
2.01k stars 560 forks source link

CRUD in Admin How to #1654

Closed vector-man closed 3 years ago

vector-man commented 3 years ago

I want to use Piranha as a headless CMS. I need to add CRUD functionally for my entities, that I can manage from the backend (and later access with EF). I'm using a database entity called Contest (there's a collection of Contests), that has several properties, such as Name, Date, and Entrant (an instance of User class). I need the entities to show as menu items in the admin, where I can set all of the values, including Entrant (getting me a combo box of Users to select.)

How would I go about creating a CRUD inside Piranha's admin (from code)? After creating the CRUD, I want to access the data with EF on the frontend. Is support for this built in, or do I need to add all of this functionality the usual way for ASP.NET Core?

tidyui commented 3 years ago

If you won't base your custom content on any of the data types built into Piranha you should just create your own DbContext and then add pages into the manager for editing them just like you would in any asp.net application!

Regards