Vici.CoolStorage: filter with ManyToOne and ManyToMany relationship

I have an exception in Vici.CoolStorage 'Unable to overlay object of type' System.String 'on type' QueryExpression 'when using the following filter in the .List () method of my Event class:

Event.List("has(Resource where has(Teams where TeamID = @TeamID))", 
                "@TeamID", teamID);

      

-> Event - Resource = ManyToOne relationship (resource property)

-> Resource - Team = ManyToMany relationship, plural = true (CSList Teams property)

I want to get all events with a resource that belongs to the specified team (teamID). Is this possible in Vici.CoolStorage filter syntax?

ps. teamID = Guid

+2


source to share


1 answer


The has () function should only be used with * ToMany relationships. I think you mean this:

I am assuming you want to select all records that have a linked resource owned by a specific team?



This might be what you are looking for:

Event.List("has(Resource.Teams where TeamID = @TeamID))", 
            "@TeamID", teamID);

      

+1


source







All Articles