小编Kru*_*mar的帖子

InvalidOperationException:记录读取器索引不同步

我有使用 mongodb 作为后端的 asp.net 核心应用程序。

最近,我开始收到此错误,而数据库或代码没有任何更改。

这是我浏览 API 时遇到的完整错误

An error occurred while starting the application.
InvalidOperationException: Record reader index out of sync.
DnsClient.DnsRecordFactory.GetRecord(ResourceRecordInfo info)

DnsResponseException: Unhandled exception
DnsClient.LookupClient.ResolveQuery(DnsMessageHandler handler, DnsRequestMessage request, Audit continueAudit)

InvalidOperationException: Record reader index out of sync.
DnsClient.DnsRecordFactory.GetRecord(ResourceRecordInfo info)
DnsClient.DnsMessageHandler.GetResponseMessage(ArraySegment<byte> responseData)
DnsClient.DnsUdpMessageHandler.Query(IPEndPoint server, DnsRequestMessage request, TimeSpan timeout)
DnsClient.LookupClient.ResolveQuery(DnsMessageHandler handler, DnsRequestMessage request, Audit continueAudit)

Show raw exception details
DnsResponseException: Unhandled exception
DnsClient.LookupClient.ResolveQuery(DnsMessageHandler handler, DnsRequestMessage request, Audit continueAudit)
DnsClient.LookupClient.Query(DnsQuestion question)
MongoDB.Driver.Core.Configuration.ConnectionString.Resolve()
MongoDB.Driver.MongoUrl.Resolve()
MongoDB.Driver.MongoClientSettings.FromUrl(MongoUrl url)
MongoDbGenericRepository.MongoDbContext..ctor(string connectionString, string databaseName) …
Run Code Online (Sandbox Code Playgroud)

c# mongodb asp.net-core mongodb-atlas

7
推荐指数
1
解决办法
837
查看次数

验证未在OnSubmit上触发,但在OnVallidSubmit上触发

我在blazor中有简单的形式,如下所示。

    <EditForm Model="@createInvoice"  OnValidSubmit="@CreateInvoice" >
    <DataAnnotationsValidator></DataAnnotationsValidator>
    <p>
        <label for="ddlService">Service</label>
        <InputSelect id="ddlService" @bind-Value="@createInvoice.SelectedService">
            <option value="0">Select Service</option>
            @foreach (var item in Services)
            {
                <option value="@item.ServiceId">@item.Name</option>
            }
        </InputSelect>
        <ValidationMessage For="@(()=> createInvoice.SelectedService)"></ValidationMessage>
    </p>
</EditForm>
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用数据注释属性来验证表单。使用editform的OnSubmit提交表单,但在提交之前未触发验证。如果我使用OnValidSubmit,它将触发验证。

有人可以解释OnSumbit,OnValidSubmit和OnInvalidSubmit如何工作。

blazor

0
推荐指数
1
解决办法
56
查看次数

标签 统计

asp.net-core ×1

blazor ×1

c# ×1

mongodb ×1

mongodb-atlas ×1