Uploaded image for project: 'Entity Framework'
  1. Entity Framework
  2. EF-177

Composite BsonId throws

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 8.1.1
    • Dotnet Drivers

      Hi,

       

      I'm trying to have a composite BsonId with EF Core. 

      public class MyEntity {
          [BsonId]
          public MyEntityKey Id { get; set; }
      }
      
      public class MyEntityKey {
          public string ABC { get; set; }
          public string XYZ { get; set; }
      }

      When querying it, it throws an exception: 

      await this.DbSet.FirstOrDefaultAsync(entity => entity.Id.ABC == "1" && entity.Id.XYZ == "2", cancellationToken);
      System.NotSupportedException: 'Unsupported shadow property 'TempId' identified on entity type 'MyEntity'.'

            Assignee:
            Unassigned Unassigned
            Reporter:
            ellepitre@dns1.sherweb.com Etienne Lepage-Lepitre
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: