0

I am trying to get the stored data from the Azure table. However, when I am trying to parse the stored id from type Guid, I will get an empty Guid 00000000-0000-0000-0000-000000000000.

public async Task<List<T>> GetItemsAsync<T>() where T : class, ITableEntity
{        
    return await _skuTableClient.QueryAsync<T>().ToListAsync().ConfigureAwait(false);
}

This is my function to retrieve the data. T is in my case SkuInfoDto:

public class SkuInfoDto : ISkuInfo, ITableEntity
{
    public Guid Id { get; set; }
    public string Name { get; set; }
  
    public string Supplier { get; set; }

    public LicenseType Type { get; set; }

    public Guid EntraIdGroupId { get; set; }

    public string PartitionKey { get; set; }
    public string RowKey { get; set; }

    public DateTimeOffset? Timestamp { get; set; } = DateTimeOffset.UtcNow;
    public ETag ETag { get; set; } = ETag.All;
}
4
  • Please provide more information about your schema. Or produce a minimal reproducable example. How is the Id configured? Do you set an Id while inserting? Commented yesterday
  • 2
    @Lukas, Change the Guid properties in your class to string and manually convert them to/from Guid to avoid deserialization issues with Azure Table SDK. Commented yesterday
  • 1
    Can you give us an example of the Id value that you expect converts to a Guid?
    – DavidG
    Commented yesterday
  • 1
    Store something like "3fa85f64-5717-4562-b3fc-2c963f66afa6" as a string in your class and later convert it back to a Guid in code using Guid.Parse(stringValue) Commented yesterday

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.