You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spend a lot of time figuring this one out. This code does not update the collection if the property is null at insert, if the property is empty (i.e.: Array.Empty()) it will work.
var bob = new Customer
{
Id = Guid.Parse("9f286de2-10ae-4366-aa35-d582b64f6f4d"),
Age = 35,
FirstName = "Bob",
LastName = "Smith",
};
var customerOne = provider.RedisCollection<Customer>();
await customerOne.InsertAsync(bob);
var test1 = await customerOne.Where(x => x.Age == 35).ToListAsync(); // this is to have it in the snapshot!
bob.Tags = new[] { "some tag" };
await customerOne.UpdateAsync(bob);
[Document(StorageType = StorageType.Json)]
public class Customer
{
[RedisIdField] public Guid Id { get; set; }
[Indexed] public string FirstName { get; set; }
[Indexed] public string[] Tags { get; set; }
[Indexed] public string LastName { get; set; }
[Indexed] public string Email { get; set; }
[Indexed] public int Age { get; set; }
}
The text was updated successfully, but these errors were encountered:
zulander1
changed the title
Updating an object which the collection is null is not working
Updating an object which the collection which is null is not working
Sep 25, 2022
zulander1
changed the title
Updating an object which the collection which is null is not working
Updating a collection that has been initialized with null is not working
Sep 25, 2022
Spend a lot of time figuring this one out. This code does not update the collection if the property is null at insert, if the property is empty (i.e.: Array.Empty()) it will work.
The text was updated successfully, but these errors were encountered: