-
Notifications
You must be signed in to change notification settings - Fork 3
Query on relationship IDs causes unexpected exception #83
Copy link
Copy link
Open
Description
When trying to query on a HasManyIds field, Argo throws an unexpected exception. If this is not supported, then Argo should throw a more appropriate exception. If it should be supported, then this should succeed.
[Model]
public class Person
{
[HasManyIds("addresses")]
public IEnumerable<Guid> AddressIds { get; }
[HasMany]
public ICollection<Address> Addresses { get; set; }
}
// This throws the exception below
session.CreateQuery<Person>()
.Where(p => p.AddressIds.Contains(addressId))
.ToList();System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at RedArrow.Argo.Client.Linq.RemoteQueryable`1.GetJsonName(MemberInfo member)
at RedArrow.Argo.Client.Linq.Queryables.WhereQueryable`1.TranslateMemberExpression(Expression expression)
at RedArrow.Argo.Client.Linq.Queryables.WhereQueryable`1.TranslateExpression(Expression expression)
at RedArrow.Argo.Client.Linq.Queryables.WhereQueryable`1.TranslateMethodCallExpression(Expression expression)
at RedArrow.Argo.Client.Linq.Queryables.WhereQueryable`1.TranslateExpression(Expression expression)
at RedArrow.Argo.Client.Linq.Queryables.WhereQueryable`1.BuildQuery()
at RedArrow.Argo.Client.Linq.RemoteQueryable`1.GetEnumerator()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
***censored***
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels