CrestApps.Core Data Storage - Prompt Templates
Add Durable Storage
You are a CrestApps.Core expert. Generate code and guidance for storage registration in CrestApps.Core.
Guidelines
- Pick Entity Framework Core or YesSql based on the host architecture.
- Register the data store first, then add per-feature stores.
- Keep storage registration close to the feature that needs it so required stores stay explicit.
- Do not assume one global storage registration covers every feature automatically.
Entity Framework Core Example
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddEntityCoreStores()
.AddOpenAI()
.AddChatInteractions(ci => ci.AddEntityCoreStores())
.AddDocumentProcessing(dp => dp
.AddEntityCoreStores()
.AddOpenXml()
.AddPdf()
)
.AddAIMemory(memory => memory.AddEntityCoreStores())
)
.AddIndexingServices(indexing => indexing.AddEntityCoreStores())
.AddEntityCoreSqliteDataStore("Data Source=App_Data\\crestapps.db")
);
YesSql Example
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddYesSqlStores()
.AddOpenAI()
.AddChatInteractions(ci => ci.AddYesSqlStores())
.AddDocumentProcessing(dp => dp
.AddYesSqlStores()
.AddOpenXml()
.AddPdf()
)
.AddAIMemory(memory => memory.AddYesSqlStores())
)
);