Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing issue on Bulk Update of a table(has table splits) #352

Closed
Bhargavi88 opened this issue Jun 18, 2020 · 2 comments
Closed

Facing issue on Bulk Update of a table(has table splits) #352

Bhargavi88 opened this issue Jun 18, 2020 · 2 comments

Comments

@Bhargavi88
Copy link

I have an entity Order which has a table split as in (https://docs.microsoft.com/en-us/ef/core/modeling/table-splitting).

public class Order
{
public int Id { get; set; }
public OrderStatus? Status { get; set; }
public DetailedOrder DetailedOrder { get; set; }
}

public class DetailedOrder
{
public int Id { get; set; }
public OrderStatus? Status { get; set; }
public string BillingAddress { get; set; }
public string ShippingAddress { get; set; }
public byte[] Version { get; set; }
}

modelBuilder.Entity(dob =>
{
dob.ToTable("Orders");
dob.Property(o => o.Status).HasColumnName("Status");
});

modelBuilder.Entity(ob =>
{
ob.ToTable("Orders");
ob.Property(o => o.Status).HasColumnName("Status");
ob.HasOne(o => o.DetailedOrder).WithOne()
.HasForeignKey(o => o.Id);
});

When I try to perform BulkUpdate as _context.BulkUpdate(orders), I am seeing issue "The specified schema name "dbo" either does not exist or you do not have permission to use it.
Microsoft.Data.SqlClient.SqlException (0x80131904): The specified schema name "dbo" either does not exist or you do not have permission to use it".

Does this support table splits or Is there any way to configure for splits?

@borisdj
Copy link
Owner

borisdj commented Jun 25, 2020

Table splits are not currently supported.

@borisdj
Copy link
Owner

borisdj commented Mar 21, 2021

This can be achieved with 2 calls to BulkUpdate, configuring DestinationName and PropsToExclude.
Similar to Owned type in separate tables: #114 (comment)

@borisdj borisdj closed this as completed Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants