diff --git a/LiteDB/Client/Mapper/BsonMapper.cs b/LiteDB/Client/Mapper/BsonMapper.cs index 8cc61e8ff..1b963f560 100644 --- a/LiteDB/Client/Mapper/BsonMapper.cs +++ b/LiteDB/Client/Mapper/BsonMapper.cs @@ -328,7 +328,8 @@ protected virtual EntityMapper BuildEntityMapper(Type type) this.ResolveMember?.Invoke(type, memberInfo, member); // test if has name and there is no duplicate field - if (member.FieldName != null && mapper.Members.Any(x => x.FieldName.Equals(name, StringComparison.OrdinalIgnoreCase)) == false) + // when member is not ignore + if (member.FieldName != null && mapper.Members.Any(x => x.FieldName.Equals(name, StringComparison.OrdinalIgnoreCase)) == false && !member.IsIgnore) { mapper.Members.Add(member); } diff --git a/LiteDB/Client/Mapper/MemberMapper.cs b/LiteDB/Client/Mapper/MemberMapper.cs index fe648fb1e..0e199f9cb 100644 --- a/LiteDB/Client/Mapper/MemberMapper.cs +++ b/LiteDB/Client/Mapper/MemberMapper.cs @@ -63,5 +63,10 @@ public class MemberMapper /// When property is an array of items, gets underlying type (otherwise is same type of PropertyType) /// public Type UnderlyingType { get; set; } + + /// + /// Is this property ignore + /// + public bool IsIgnore { get; set; } } } \ No newline at end of file