I want to manipulate data directly into database. But the changes not reflected in Orchard Website. How can tell to Orchard clear all database cache after making some data changes in database?
2 Answers
I assume you are adding records to the table LayerPartRecord? This won't work because layers are content items in Orchard, they are built from more tables than just the layerpartrecord table. You will have to add records to several other tables. It begs the question, why are you trying to do this? Orchard does not lend itself to direct database modification. Sebastien Ros talks a little about Orchards database structure here, if you really have your heart set on modifying the database: http://sebastienros.com/understanding-orchard-s-database, but I'd definitely say it is more trouble than it is worth.
Instead you can create layers using the Orchard command line:
layer create Authenticated /LayerRule:"authenticated" /Description:"The widgets in this layer are displayed when the user is authenticated"
Or use the Import/Export module, so your import code will look something like this:
<Layer Id="/Layer.LayerName=Authenticated" Status="Published">
<CommonPart Owner="/User.UserName=admin" CreatedUtc="2014-07-01T12:22:26Z" PublishedUtc="2014-07-01T12:22:26Z" ModifiedUtc="2014-07-01T12:22:26Z"/>
<LayerPart Name="Authenticated" Description="The widgets in this layer are displayed when the user is authenticated" LayerRule="authenticated"/>
</Layer>