Hi i want use clear C# class without reference\independent to mongodb. Id is Guid. Now my main problem is dublicate ids, example:
public class Car
{
public Guid CarId { get; set; }
public string Name { get; set; }
}
And on init conventio:
var pack = new ConventionPack {new IgnoreExtraElementsConvention(true)};
Default use case:
cars.find(c => c.CarId == carId).FirstOfDefault();
In database i have never used _id field
Can use only one field id, clear class (without ref\using\attribute\etc) with C# Guid?
Examble what need:
public class Car
{
public Guid _id { get; set; }
public string Name { get; set; }
}
ConventionRegistry.Register( default_id_field_name = ‘_id’ );
ConventionRegistry.Register( default_id_type = Guid);