Azure / Azure/Azure-Functions

Query Rgearding Fetch data from multiple tables in ServiceStack ORMLite

Open
#2,487 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

**Problem Statement:**
The ORMLite framework in Azure Function with.NET 8 is what we're using to fetch data from multiple tables using SQL joins and select into a single model. However, when I run this query, the only table that returns is NoteTemplateFolders, even though I want the data from every table that I select in the SQL expression.

Please provide guidance and possible solutions for the above mentioned scenario.

**My Code:**
```csharp
SqlExpression sqlExpression = _tenantDatabase.From()
.Join((folder, template) => folder.Id == template.FolderId)
.Where(x => x.Name == "Template 342079")
.Select((folder, template) => new
{
FolderId = folder.Id,
FolderName = folder.Name,
Id = template.Id,
Name = template.Name,
ClientName = "Test"
});

List response = _tenantDatabase.Select(sqlExpression);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.