Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
92 views
in Technique[技术] by (71.8m points)

c# - Breeze# 'Member is not Supported'

I'm having issues executing a simple breeze# query with a Where clause that has an entity relation in it. Note, filtering by props that are on the DatHood entity does not have an issue. My query in question looks like this:

var query = new EntityQuery<DatHood>().Where(z => z.Facility.RegionId == regionId).Expand("Facility");
var hoods = await EM.ExecuteQuery(query); 

ExecuteQuery throws:

The member 'RegionId' is not supported

with the StackTrace being:

 at Breeze.Sharp.Json.JsonQueryExpressionVisitor.VisitMember(MemberExpression m)
   at System.Linq.Expressions.MemberExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Breeze.Sharp.Json.JsonQueryExpressionVisitor.VisitBinaryComparison(BinaryExpression b, String op)
   at Breeze.Sharp.Json.JsonQueryExpressionVisitor.VisitBinary(BinaryExpression b)
   at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Breeze.Sharp.Json.JsonQueryExpressionVisitor.VisitMethodCall(MethodCallExpression m)
   at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Breeze.Sharp.Json.JsonQueryExpressionVisitor.VisitMethodCall(MethodCallExpression m)
   at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Breeze.Sharp.Json.JsonQueryExpressionVisitor.VisitRoot(Expression expression)
   at Breeze.Sharp.Json.JsonQueryExpressionVisitor.Translate(Expression expression)
   at Breeze.Sharp.EntityQuery`1.GetJsonResourcePath(String resourceName)
   at Breeze.Sharp.EntityQuery`1.GetResourcePath(MetadataStore metadataStore)
   at Breeze.Sharp.EntityManager.<ExecuteQuery>d__42.MoveNext()

My client entities:

public partial class DatHood : BaseEntity
{
    public DatHood() {}

    public Guid HoodGuid { get { return GetValue<Guid>(); } set { SetValue(value); } }
    .
    .
    [ForeignKey("Facility")]
    public string FacilityId { get { return GetValue<string>(); } set { SetValue(value); } }
    public DatCustomer Facility { get { return GetValue<DatCustomer>(); } set { SetValue(value); } }
}

public partial class DatCustomer : BaseEntity
{
    public DatCustomer() {}

    public string FacilityId { get { return GetValue<string>(); } set { SetValue(value); } }
    public bool FacilityStatus { get { return GetValue<bool>(); } set { SetValue(value); } }
    public string RegionId { get { return GetValue<string>(); } set { SetValue(value); } }
    .
    .
}

Any light on how to resolve the 'member is not supported' exception would be greatly appreciated!

question from:https://stackoverflow.com/questions/65928842/breeze-member-is-not-supported

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...