forked from ddrilling/AsbCloudServer
ProcessMapPlanBaseRepository cut off Autor and Editor navigation properties on insert
This commit is contained in:
parent
271b9d363d
commit
f0e0a829f6
@ -64,4 +64,12 @@ public class ProcessMapPlanBaseRepository<TDto, TEntity> : ChangeLogRepositoryAb
|
||||
dto.Section = entity.WellSectionType.Caption;
|
||||
return dto;
|
||||
}
|
||||
|
||||
protected override TEntity Convert(TDto dto)
|
||||
{
|
||||
var entity = base.Convert(dto);
|
||||
entity.Author = null;
|
||||
entity.Editor = null;
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ using AsbCloudWebApi.IntegrationTests.Data;
|
||||
using Refit;
|
||||
using Xunit;
|
||||
using AsbCloudApp.Data.ProcessMaps;
|
||||
using AsbCloudDb.Model;
|
||||
using AsbCloudApp.Data.User;
|
||||
|
||||
namespace AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan;
|
||||
|
||||
@ -194,6 +196,9 @@ public class ProcessMapPlanDrillingControllerTest: BaseIntegrationTest
|
||||
var startTime = DateTimeOffset.UtcNow;
|
||||
|
||||
var dbset = dbContext.Set<ProcessMapPlanDrilling>();
|
||||
var user = dbContext.Set<User>().First().Adapt<UserDto>();
|
||||
user.Surname = "userSurname";
|
||||
user.Email = "user@mail.domain";
|
||||
|
||||
var entry = dbset.Add(entity);
|
||||
dbContext.SaveChanges();
|
||||
@ -216,6 +221,7 @@ public class ProcessMapPlanDrillingControllerTest: BaseIntegrationTest
|
||||
dtoUpdate.TopDriveSpeedLimitMax++;
|
||||
dtoUpdate.TopDriveTorquePlan++;
|
||||
dtoUpdate.TopDriveTorqueLimitMax++;
|
||||
dtoUpdate.Author = user;
|
||||
|
||||
var dtoInsert = dtoUpdate.Adapt<ProcessMapPlanDrillingDto>();
|
||||
dtoInsert.Id = 0;
|
||||
@ -233,6 +239,7 @@ public class ProcessMapPlanDrillingControllerTest: BaseIntegrationTest
|
||||
dtoInsert.TopDriveSpeedLimitMax++;
|
||||
dtoInsert.TopDriveTorquePlan++;
|
||||
dtoInsert.TopDriveTorqueLimitMax++;
|
||||
dtoInsert.Author = user;
|
||||
|
||||
// act
|
||||
var result = await client.UpdateOrInsertRange(entity.IdWell, new ProcessMapPlanDrillingDto[] { dtoUpdate, dtoInsert });
|
||||
|
Loading…
Reference in New Issue
Block a user