Skip to content

Commit b61a333

Browse files
committed
CSHARP-3971: Make ExpressionNotSupportedException public.
1 parent 661bcd3 commit b61a333

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/MongoDB.Driver/Linq/Linq3Implementation/ExpressionNotSupportedException.cs renamed to src/MongoDB.Driver/Linq/ExpressionNotSupportedException.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
using System;
1717
using System.Linq.Expressions;
1818

19-
namespace MongoDB.Driver.Linq.Linq3Implementation
19+
namespace MongoDB.Driver.Linq
2020
{
21-
internal class ExpressionNotSupportedException : NotSupportedException
21+
/// <summary>
22+
/// Exception that is thrown when using a LINQ expression that is not supported.
23+
/// </summary>
24+
public class ExpressionNotSupportedException : NotSupportedException
2225
{
2326
#region static
2427
private static string FormatMessage(Expression expression)
@@ -33,16 +36,29 @@ private static string FormatMessage(Expression expression, Expression containing
3336
#endregion
3437

3538
// constructors
39+
/// <summary>
40+
/// Initializes an instance of an ExpressionNotSupportedException.
41+
/// </summary>
42+
/// <param name="message">The message.</param>
3643
public ExpressionNotSupportedException(string message)
3744
: base(message)
3845
{
3946
}
4047

48+
/// <summary>
49+
/// Initializes an instance of an ExpressionNotSupportedException.
50+
/// </summary>
51+
/// <param name="expression">The expression.</param>
4152
public ExpressionNotSupportedException(Expression expression)
4253
: base(FormatMessage(expression))
4354
{
4455
}
4556

57+
/// <summary>
58+
/// Initializes an instance of an ExpressionNotSupportedException.
59+
/// </summary>
60+
/// <param name="expression">The expression.</param>
61+
/// <param name="containingExpression">The containing expression.</param>
4662
public ExpressionNotSupportedException(Expression expression, Expression containingExpression)
4763
: base(FormatMessage(expression, containingExpression))
4864
{

tests/MongoDB.Driver.Tests/Linq/Linq2ImplementationTestsOnLinq3/Translators/PredicateTranslatorTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
using MongoDB.Bson.Serialization;
2424
using MongoDB.Driver;
2525
using MongoDB.Driver.Core.TestHelpers.XunitExtensions;
26-
using MongoDB.Driver.Linq.Linq3Implementation;
26+
using MongoDB.Driver.Linq;
2727
using MongoDB.Driver.Linq.Linq3Implementation.Misc;
28-
using MongoDB.Driver.Linq.Linq3Implementation.Serializers.KnownSerializers;
2928
using MongoDB.Driver.Linq.Linq3Implementation.Translators;
3029
using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators;
3130
using Xunit;

0 commit comments

Comments
 (0)