EFCore.BulkExtensions icon indicating copy to clipboard operation
EFCore.BulkExtensions copied to clipboard

[Key] does not support customization?

Open AtlantisDe opened this issue 1 year ago • 0 comments

  • Test new string ID
  • context.BulkInsertOrUpdate(items, b => b.SetOutputIdentity = true);
  • Error System.InvalidOperationException: 'No mapping exists from object type System.RuntimeType to a known managed provider native type.'
public class Student : TopBasePoco
{
    [Key]
    [StringLength(36)]
    public new string ID { get; set; }
    // 。。。。
}

//Test
 context.BulkInsertOrUpdate(items, b => b.SetOutputIdentity = true);

//Is Failed

// System.InvalidOperationException: 'No mapping exists from object type System.RuntimeType to a known managed provider native type.'
//
// Summary:
//     TopBasePoco
public class TopBasePoco
{
    private bool? _isBasePoco;

    //
    // Summary:
    //     Id
    [Key]
    public Guid ID { get; set; }

AtlantisDe avatar Apr 08 '24 07:04 AtlantisDe