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
Documentation for CRUD in the Database #2248
Comments
http://sqlitebrowser.org/ |
Thanks for your Response @zl2fxy. So does that mean that i have to deal it myself? |
you can't do it by yourself,the orchardcore has many good supplies,you can download it(yessql) and use it for orchardcore, Ctrl+F12,I think you can find something of you needs; |
Yes, I meaned YesSql. @zl2fxy Do you have an idea where i can get the database connection? |
You should take a look at the source code. One good, simple enough, example could be the Deployment admin controller. The controller gets ISession through DI and has action methods for each CRUD operation of "DeploymentPlan". Remember that in order for this to work you need to add an index provider, required by yesql: And you will need a migration to create the table for your object: Index and migration will need the corresponding services registered in startup.cs
With this setup your table should be created when you first enable your module using the admin. |
Thank you @matiasmolleja, thats are some great instructions I appreciate it 🥇 |
When you mention CRUD it's not clear if you mean with the Document model or raw tables. Both are doable, @matiasmolleja gave you some examples for the document model. You can also create flat tables using Dapper, which we do for instance in the Indexing module. You just get the connection from an |
Thank you for the respond @sebastienros , so I have the chance to use direct SQL and/or I would use your YesSql project. Is there any instance for YesSql that is shared among the different modules? And btw, if you are planning to translate the documentation to German I would willing to help out there, because my native language is German. |
@matiasmolleja is there any documentation on Migrations? I couldnt find any in the YesSql Repository. |
Migrations are in OC |
@jonkas2211 The ISession instance is provided by the DI and is unique to all modules during a request. |
What is doable is to inject the |
@sebastienros would it be possible to create an ExtendedSession object that inherits from Session and inject that Orchard Core instead of the Session Object? The ExtendedSession object could have a generic |
@sebastienros You have created a better framework in YesSql for saving data than Dapper.Contrib or any of the other Dapper Project. The Dapper base project doesn't save data to the database unless you write the raw SQL yourself. For instance, I could create a
|
Hello,
is there any documentation on how to interact with the database through OC?
I couldnt find any, I had to read the poor documented source code and that is not how it supposed to be.
I found out that the ContentManager, I think so, is dealing with creating ContentItems, but the system isnt really documented so its a bit tricky to find out , how to use it.
If there is any documentation then please let me know, because I really want to use OrchardCore for my following projects, but without documentation I cant.
Thanks :)
The text was updated successfully, but these errors were encountered: