MSAzure-BadRequest400.EmailAddress==email).ToListAsync();以下是错误消息:“Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException”类型的第一次机会异常发生在mscorlib.dllMicrosoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException中:请求无法完成。(错误请求)在Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.d__18.MoveNext()---从上一个抛出异常的位置开始的堆栈跟踪结束---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在System.Runtime.CompilerServices.TaskAwaiter.GetResult()在Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.d__1d.MoveNext()---堆栈结束t从先前抛出异常的位置---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Tasktask)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tasktask)在System.Runtime.CompilerServices.TaskAwaiter`1。Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.d__4.MoveNext()处的GetResult()---从先前抛出异常的位置开始的堆栈跟踪结束---System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Tasktask)atSystem.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tasktask)atSystem.Runtime.CompilerServices.TaskAwaiter`1.GetResult()atMicrosoft.WindowsAzure.MobileServices.MobileServiceTable.d__b.MoveNext()---上一位置的堆栈跟踪结束抛出异常的地方---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Tasktask)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tasktask)atSystem.Runtime.CompilerServices.TaskAwaiter`1.GetResult()atMicrosoft.WindowsAzure.MobileServices.MobileServiceTable.d__4.MoveNext()---从抛出异常的先前位置开始的堆栈跟踪结束---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()在Microsoft.WindowsAzure.MobileServices.Query.MobileServiceTableQueryProvider.d__8`1.MoveNext()---从先前抛出异常的位置开始的堆栈跟踪结束---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)在System.Runtime.CompilerServices。TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()在Microsoft.WindowsAzure.MobileServices.Query.MobileServiceTableQueryProvider.d__3`1.MoveNext()---从先前抛出异常的位置开始的堆栈跟踪结束---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tasktask)atSystem.Runtime.CompilerServices.TaskAwaiter`1.GetResult()atMicrosoft.WindowsAzure.MobileServices.MobileServiceTableQuery`1.d__0.MoveNext()---从抛出异常的先前位置开始的堆栈跟踪结束---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()在eventsphere.Utilities。ValidationUtility.d__2.MoveNext()但我有另一条线基本相同,它工作正常:Listaccounts=awaitApp.accountTable.Where(account=>account.Username==username).ToListAsync();我几乎一无所知,为什么一行会给我一个错误,另一行不会,因为所有更改都是我正在查询的帐户表的属性帐户表结构:(不会让我张贴图片,因为我没有足够的声誉)CREATETABLE[eventsphere].[Accounts]([Id]NVARCHAR(128)DEFAULT(newid())NOTNULL,[AccountId]INTIDENTITY(1,1)NOTNULL,[用户名]NVARCHAR(MAX)NULL,[EmailAddress]NVARCHAR(MAX)NULL,[密码]NVARCHAR(MAX)NULL,[IsBusiness]BITNOTNULL,[User_Id]NVARCHAR(128)NULL,[Business_Id]NVARCHAR(128)NULL,[Version]ROWVERSIONNOTNULL,[CreatedAt]DATETIMEOFFSET(7)DEFAULT(sysutcdatetime())NOTNULL,[UpdatedAt]DATETIMEOFFSET(7)NULL,[Deleted]BITNOTNULL,CONSTRAINT[PK_eventsphere.Accounts]主键非聚集([Id]ASC),CONSTRAINT[FK_eventsphere.Accounts_eventsphere.Business_Business_Id]FOREIGNKEY([Business_Id])引用[eventsphere]。[企业]([Id]),CONSTRAINT[FK_eventsphere.Accounts_eventsphere.Users_User_Id]FOREIGNKEY([User_Id])REFERENCES[eventsphere].[Users]([Id]));任何投入将不胜感激!提前致谢:)您的客户EmailAddress属性是什么样的?它在某个时候变得很低-您的客户端模型中是否有任何属性?“用户Firstname”和“username”都有效,因为服务器允许大写和小写首字母。例如,“emailAddress”应该有效。(直到我有10个声誉才能发表评论,所以我将其发布为答案..)这是生成并发送到数据库本地副本的查询请求:http://localhost:59737/tables/Account?$filter=(emailaddress%20eq%20%27email%40test.com%27)返回这个对象(我认为“消息”属性很重要):{“消息”:“URI中指定的查询无效。无法在类型“eventsphereService.DataObjects.Account”上找到名为“emailaddress”的属性。:“Microsoft.Data.OData.ODataException”,“stackTrace”:“在Microsoft.Data.OData.Query.EndPathBinder.GeneratePropertyAccessQueryForOpenType(EndPathTokenendPathToken,SingleValueNodeparentNode)rn在Microsoft.Data.OData.Query.EndPathBinder.BindEndPath(EndPathTokenendPathnStatenate,绑定)在Microsoft.Data.OData.Query.MetadataBinder.BindEndPath(EndPathTokenendPathToken)rn在Microsoft.Data.OData.Query.MetadataBinder.Bind(QueryToken令牌)rn在Microsoft.Data.OData.Query.BinaryOperatorBinder.GetOperandFromToken(BinaryOperatorKindoperatorKind,QueryTokenqueryToken)在Microsoft.Data.OData.Query.BinaryOperatorBinder.BindBinaryOperator(BinaryOperatorTokenbinaryOperatorToken)在Microsoft.Data.OData.Query.MetadataBinder.BindBinaryOperator(BinaryOperatorTokenbinaryOperatorToken)在Microsoft.Data。OData.Query.MetadataBinder.Bind(QueryToken令牌)rn在Microsoft.Data.OData.Query.FilterBinder.BindFilter(QueryToken过滤器)rn在Microsoft.Data.OData.Query.ODataUriParser.ParseFilterImplementation(字符串过滤器,IEdmTypeelementType,IEdmEntitySetentitySet)rn在System.Web.Http.OData.Query.FilterQueryOption.get_FilterClause()rn在System.Web.Http.OData.Query.Validators.FilterQueryValidator.Validate(FilterQueryOptionfilterQueryOption,ODataValidationSettings设置)rn在System.Web.Http。OData.Query.FilterQueryOption.Validate(ODataValidationSettingsvalidationSettings)rn在System.Web.Http.OData.Query.Validators.ODataQueryValidator.Validate(ODataQueryOptions选项,ODataValidationSettingsvalidationSettings)rn在System.Web.Http.OData.Query.ODataQueryOptions.Validate(ODataValidationSettingsvalidationSettings)rn在System.Web.Http.OData.EnableQueryAttribute.ValidateQuery(HttpRequestMessage请求,ODataQueryOptionsqueryOptions)rn在System.Web.Http.OData.EnableQueryAttribute.ExecuteQuery(Objectresponse,HttpRequestMessagerequest,HttpActionDescriptoractionDescriptor)rnatSystem.Web.Http.OData.EnableQueryAttribute.OnActionExecuted(HttpActionExecutedContextactionExecutedContext)"}如下:http://localhost:59737/tables/Account?$filter=(EmailAddress%20eq%20%27email%40test.com%27)查询username字段返回一些数据,"username"和"username"都返回数据。AccountDataObject定义为:以上就是C#学习教程:MSAzure-ErrorRequest400的全部内容,如果对大家有用,需要详细了解C#学习教程,希望大家多多关注它—publicclassAccount:EntityData{[DatabaseGenerated(DatabaseGeneratedOption.Identity)]publicintAccountId{get;放;}publicstring用户名{get;放;}[DataType(DataType.EmailAddress)]publicstringEmailAddress{get;放;}公共字符串密码{得到;放;}publicboolIsBusiness{得到;放;}publicstringUser_Id{得到;放;}[DatabaseGenerated(DatabaseGeneratedOption.None)][ForeignKey("User_Id")][Association("UserIdAssociation","UserId","Id")][Column(Order=1)]publicvirtualUserUser{get;放;}publicstringBusiness_Id{得到;放;}[DatabaseGenerated(DatabaseGeneratedOption.None)][ForeignKey("Business_Id")][Association("BusinessIdAssociation","BusinessId","Id")]publicvirtualBusinessBusiness{get;放;}}本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
