-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Mql.cs
115 lines (107 loc) · 4.6 KB
/
Mql.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* Copyright 2010-present MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace MongoDB.Driver
{
/// <summary>
/// Contains methods that can be used to access MongoDB specific functionality in LINQ queries.
/// </summary>
public static class Mql
{
/// <summary>
/// Converts a string to a DateTime using the $dateFromString aggregation operator.
/// </summary>
/// <param name="dateString">The string.</param>
/// <returns>A DateTime.</returns>
public static DateTime DateFromString(string dateString)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
/// <summary>
/// Converts a string to a DateTime using the $dateFromString aggregation operator.
/// </summary>
/// <param name="dateString">The string.</param>
/// <param name="format">The format string.</param>
/// <returns>A DateTime.</returns>
public static DateTime DateFromString(
string dateString,
string format)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
/// <summary>
/// Converts a string to a DateTime using the $dateFromString aggregation operator.
/// </summary>
/// <param name="dateString">The string.</param>
/// <param name="format">The format string.</param>
/// <param name="timezone">The time zone.</param>
/// <returns>A DateTime.</returns>
public static DateTime DateFromString(
string dateString,
string format,
string timezone)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
/// <summary>
/// Converts a string to a DateTime using the $dateFromString aggregation operator.
/// </summary>
/// <param name="dateString">The string.</param>
/// <param name="format">The format string.</param>
/// <param name="timezone">The time zone.</param>
/// <param name="onError">The onError value.</param>
/// <param name="onNull">The onNull value.</param>
/// <returns>A DateTime.</returns>
public static DateTime? DateFromString(
string dateString,
string format,
string timezone,
DateTime? onError,
DateTime? onNull)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
/// <summary>
/// Tests whether a field exists.
/// </summary>
/// <typeparam name="TField">The type of the field.</typeparam>
/// <param name="field">The field.</param>
/// <returns><c>true</c> if the field exists.</returns>
public static bool Exists<TField>(TField field)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
/// <summary>
/// Tests whether a field is missing.
/// </summary>
/// <typeparam name="TField">The type of the field.</typeparam>
/// <param name="field">The field.</param>
/// <returns><c>true</c> if the field is missing.</returns>
public static bool IsMissing<TField>(TField field)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
/// <summary>
/// Tests whether a field is null or missing.
/// </summary>
/// <typeparam name="TField">The type of the field.</typeparam>
/// <param name="field">The field.</param>
/// <returns><c>true</c> if the field is null or missing.</returns>
public static bool IsNullOrMissing<TField>(TField field)
{
throw new NotSupportedException("This method is not functional. It is only usable in MongoDB LINQ queries.");
}
}
}