Closed michaldivis closed 2 years ago
How do you check that relations are not copied? If three tables are successfully copied then you ca load records with relations.
OMG, sorry, we cannot copy this. You have shadow properties, which extension cannot see. If you want to copy table via this extension, you have to expand your classes.
public class User
{
[Key]
public Guid UserId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public List<string> Claims { get; set; } = new List<string>();
public Guid EmployerId { get; set; }
public User Employer { get; set; }
public List<User> Employees { get; set; } = new List<User>();
}
public class Order
{
[Key]
public Guid OrderId { get; set; }
public DateTime Created { get; set; }
public Guid CreatorId { get; set; }
public User Creator { get; set; }
public Guid AssignedHandlerId { get; set; }
public User AssignedHandler { get; set; }
public List<OrderState> States { get; set; } = new List<OrderState>();
}
public class OrderState
{
[Key]
public Guid OrderStateId { get; set; }
public Guid CreatedById { get; set; }
public User CreatedBy { get; set; }
public DateTime Timestamp { get; set; }
public OrderStatus Status { get; set; }
public string Message { get; set; }
}
@sdanyliv Thanks so much, that's what I've been missing.
Hi, I'd like to know if it's possible to also copy any related entities when using the
BulkCopy
extension method.Here's my use case:
Here's how I'm trying to copy the data:
Is there a way to achieve this?