locked
TextBlobbed List<DayOfWeek> store in sqlite deserialize null RRS feed

  • Question

  • User393096 posted

    Hello

    I want to store List DayOfWeek list in sqlite. Its working well, but when i want to use the blobbed parts containn the data, but the list is always null

    csharp [TextBlob(nameof(RepetitonDaysBlobbed))] public List<DayOfWeek> RepetitonDays { get; set; } public string RepetitonDaysBlobbed { get; set; }

    Its strange. When i check it with the debugger, i see data in the Blobbed property (example: "[0,6]" -> represent monday and sunday) but the list empty. Do you have any solution?

    Thursday, May 21, 2020 5:53 PM

Answers

  • User393096 posted

    Hello

    I think i fixed it. I dont know why, but in my DBHandler class switched synchronous from async , My list updated and working well, and filled from blobbed part. It is very strange.

    But thx for your help

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 22, 2020 8:15 AM

All replies

  • User369979 posted

    Which SQLite package did you use? I simulate this process with a simple model. And get the expected data: Could you please share your sample here to help us reproduce the issue?

    Friday, May 22, 2020 3:52 AM
  • User393096 posted

    Hello

    I use sqlite.NET PCL 1.7.335 and SQLite.NET Extensions 2.1.0

    In your solution the List is string. My List DayOfWeek type, so maybe thats why not working.

    I changed the list to string, but the result is the same

    Friday, May 22, 2020 6:25 AM
  • User369979 posted

    Still the expected string: Here is the package I used. Could you please share your sample?

    Friday, May 22, 2020 7:05 AM
  • User393096 posted

    Yes, i use this packages.

    I switched to string, to get better result, but same.

    Here a screenshot:

    Its very strange. Maybe i need an extra serializer to put the data from the blobbed property back to the list?

    Friday, May 22, 2020 7:15 AM
  • User369979 posted

    Try to reproduce this with a blank new project and post it here. We need it to know how you store and read data. I don't know what happened on your side without the code.

    Friday, May 22, 2020 7:29 AM
  • User393096 posted

    Hello

    I think i fixed it. I dont know why, but in my DBHandler class switched synchronous from async , My list updated and working well, and filled from blobbed part. It is very strange.

    But thx for your help

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 22, 2020 8:15 AM
  • User369979 posted

    Glad you made it. Please mark it to end this discussion.

    Friday, May 22, 2020 8:52 AM