I am on LLBLGen Pro 5.05. Adapter. Vanilla templates.
The Id used to Int. Then I changed it to Guid and sync it with llblgen.
var res = await Command.DoAsync(async adapter =>
{
try
{
await adapter.StartTransactionAsync(System.Data.IsolationLevel.ReadUncommitted, "SaveOrUpdateTask");
var e = new PlanTaskEntity
{
Id = Guid.NewGuid(),
TaskTypeId = task.TaskTypeId,
StaffId = _staffId,
CreatedByUserId = _userId,
LastModifiedByUserId = _userId,
IsNew = true
};
await adapter.SaveEntityAsync(e, refetchAfterSave: true);
adapter.Commit();
return "";
}
catch(Exception ex)
{
return ex.Message;
}
});
generates
Test Name: Inspection.Core.Tests.Modules.REST.WeeklyManagementTests.BasicInsert
Test FullName: Inspection.Core.Tests.Modules.REST.WeeklyManagementTests.BasicInsert
Test Source: H:\Repository\Inspection\Trunk\Tests\Inspection.Core.Tests\Modules\REST\WeeklyManagementTests.cs : line 63
Test Outcome: Failed
Test Duration: 0:00:02.2
Result StackTrace:
at Inspection.Core.Tests.Modules.REST.WeeklyManagementTests.<BasicInsert>d__6.MoveNext() in H:\Repository\Inspection\Trunk\Tests\Inspection.Core.Tests\Modules\REST\WeeklyManagementTests.cs:line 105
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Result Message:
An exception was caught during the execution of an action query: Cannot insert the value NULL into column 'Id', table 'Inspection.dbo.PlanTask'; column does not allow nulls. INSERT fails.
The statement has been terminated.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Expected: True
Actual: False