1

SQL に数百のフィールドを持つエンティティがたくさんありますが、数十は null 不可です。私はエンティティを作成し、保存して、これを簡単に含めることができるようにどのフィールドを保存して確認することを望んでいましたが、EFから返された情報にはどのフィールド/プロパティが表示されませんエラーの原因は?これはなぜでしょうか?私もtry/catchを行い、例外を出力し、問題に関する追加情報はありません:-(

System.Data.UpdateException : An error occurred while updating the entries. See the inner exception for details.
  ----> System.Data.SqlTypes.SqlTypeException : SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
   at PaymentDomain.IntegrationTests.EFTestSetup.Test() in EFTestSetup.cs: line 40
--SqlTypeException
   at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 completion, Int32 startRpc, Int32 startParam)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, ref Task task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, ref Task task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
   at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)

クール、次のようなものはどうですか: CreateDate

ありがとう...

4

1 に答える 1

0

DbContext.GetValidationErrors()メソッドを使用して、検証ルールのブレーク情報を取得できます。MSDN の記事

于 2013-06-25T21:10:48.953 に答える