private static FieldsBuilder ParseProjection(string projection) { var fields = new FieldsBuilder(); if (String.IsNullOrEmpty(projection)) return fields; var projectionDocument = BsonSerializer.Deserialize<BsonDocument>(projection); foreach (var element in projectionDocument) { var value = element.Value; if (value.IsBoolean && value.AsBoolean || value.IsInt32 && value.AsInt32 != 0) { fields.Include(element.Name); } else if (value.IsBoolean && !value.AsBoolean || value.IsInt32 && value.AsInt32 == 0) { fields.Exclude(element.Name); } else { throw Errors.InvalidProjectionFormat(); } } return fields; }
PlayerExAccess() : base("PlayerEx") { excludeFields = new FieldsBuilder(); excludeFields.Exclude("Ver", "Modified"); }