forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThrowHelper.cs
More file actions
21 lines (18 loc) · 1010 Bytes
/
ThrowHelper.cs
File metadata and controls
21 lines (18 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace Npgsql
{
static class ThrowHelper
{
[DoesNotReturn]
internal static void ThrowInvalidOperationException_NoPropertyGetter(Type type, MemberInfo property) =>
throw new InvalidOperationException($"Composite type {type} cannot be written because the {property} property has no getter.");
[DoesNotReturn]
internal static void ThrowInvalidOperationException_NoPropertySetter(Type type, MemberInfo property) =>
throw new InvalidOperationException($"Composite type {type} cannot be read because the {property} property has no setter.");
[DoesNotReturn]
internal static void ThrowInvalidOperationException_BinaryImportParametersMismatch(int columnCount, int valueCount) =>
throw new InvalidOperationException($"The binary import operation was started with {columnCount} column(s), but {valueCount} value(s) were provided.");
}
}