Decimal RepresentationConverter as allowTruncation true by default?

Hi guys,

how to set a RepresentationConverter with allowTruncation true by default on whole application?

I trying

          try { BsonSerializer.RegisterSerializer<Decimal>(new DecimalSerializer(BsonType.Decimal128, new RepresentationConverter(false, true))); }
            catch (Exception) { }

but my query is throwing “MongoDB.Bson.TruncationException: Truncation resulted in data loss.” from anonymous class

     var customers = from c in _collection.AsQueryable()
                        join p in i.AsQueryable() on c.Customer equals p.Id
                        select new
                        {
                            Id = c.Id,
                            Name = p.Name,
                            Amount = c.Amount - c.ReturnAmount - c.SkipAmount
                        } into c
                        group c by c.Name into g
                        select new
                        {
                            Customer = g.Key,
                            Amount = g.Sum(x => x.Amount)
                        };

        var others = (await customers.OrderByDescending(x => x.Amount).Skip(5).ToListAsync()).Sum(x => x.Amount);

Hi, @Matheus_Ragoso,

Welcome to the MongoDB Community Forums. Thank you for reaching out to us about this issue. Please file a CSHARP issue with a self-contained repro demonstrating the problem and we will be happy investigate further with you.

Sincerely,
James