INNER CODE UNIT · C#
EurasianOtter
BlueshiftSoftware/EntityFrameworkCore · src/Blueshift.EntityFrameworkCore.MongoDB.SampleDomain/ZooDbContext.cs:91
public class EurasianOtter : Otter { }
public class Employee
{
// When using attribute-driven data modeling, either [BsonId] or [Key]
// is required for the primary key field; either will work with the
// MongoDb C# driver EFCore adapter
[BsonId, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public ObjectId EmployeeId { get; [UsedImplicitly] private set; }
public string FirstName { get; set; }
public string LastName { get; set; }
[BsonElement]
public string FullName => string.IsNullOrWhiteSpace(FirstName)
? LastName
: $"{LastName}, {FirstName}";