Preview feature not working on drafts (.Net)

Hello,

I have some problems to implementing previews on unpublished documents in development.
In development it not works as expected. I have a document not found on drafts.

The problem is on the following line
var response = await Query(p).Ref(reference).Lang(lang).Submit();

The document could not be found with the reference Master.Reference equal "XXXXXXXXXXXXXhVT"

public async Task QueryFirst(IPredicate p, string reference = null, string lang = null)
{
reference = reference ?? Master.Reference;
lang = lang ?? "*";
var response = await Query(p).Ref(reference).Lang(lang).Submit();
var results = response.Results;
return results.FirstOrDefault();
}

public async Task GetByID(string documentId, string reference = null, string lang = null)
{
reference = reference ?? Master.Reference;
lang = lang ?? "*";
return await QueryFirst(Predicates.At("document.id", documentId), reference, lang);
}

Thanks for your help

Hi @smaabo

Thanks for reaching out, I don't know much about .Net, but I will try to investigate with you.
As a start, can you tell me what .Net kit you are using?

Meanwhile, those documents might help

Thanks for your feedback.
Here is the information concerning the .Net kit installed on my workstation.
Thanks in advance.

Environnement d'exécution :
OS Name: Windows
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.402\

Host (useful for support):
Version: 5.0.11

.NET SDKs installed:
2.2.206 [C:\Program Files\dotnet\sdk]
2.2.300 [C:\Program Files\dotnet\sdk]
3.1.300 [C:\Program Files\dotnet\sdk]
5.0.101 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]

Hi Sara,

I'm taking over this thread from Fares as he is out of office.

I didn't really understand which kit you are using, is it this one?...

or this one?...

Thanks

Hi Phil,

This one:
Prismic.io kit for the .NET Framework. Contribute to prismicio-community/dotnet-kit development by creating an account on GitHub.

Are you calling the link resolver when you are triggering your queries?

Threads close after a period of inactivity. Flag this thread to re-open it and continue the conversation.