Skip to content

HasManyIds does not reflect additions to HasMany relationship #75

@zeitlerc

Description

@zeitlerc

If an entity is added to a HasMany relationship collection, it should be added to the Ids in HasManyIds. That is currently not the case within the same session.

[Model]
public class Person
{
    [HasManyIds("pizzas")]
    public IEnumerable<Guid> PizzaIds { get; set; }
    [HasMany]
    public ICollection<Pizza> Pizzas { get; set; }
}

var moarPizza = session.Get<Pizza>(moarPizzaId);
person.Pizzas.Add(moarPizza);
await session.Update(person);
// FAILS in same session.  Succeeds in new session
Assert.True(person.PizzaIds.Contains(moarPizzaId));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions