Merge pull request #980 from StephenMcConnel/bug-18638
[mono.git] / mcs / class / System.Data.Services / System.Data.Services.Providers / DataServiceProviderMethods.cs
1 // 
2 // DataServiceProviderMethods.cs
3 //  
4 // Author:
5 //       Marek Habersack <grendel@twistedcode.net>
6 // 
7 // Copyright (c) 2011 Novell, Inc
8 // 
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 // 
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 // 
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 // THE SOFTWARE.
26
27 using System;
28 using System.Collections.Generic;
29 using System.Data.Services.Providers;
30 using System.Reflection;
31
32 namespace System.Data.Services.Providers
33 {
34         public static class DataServiceProviderMethods
35         {
36                 public static object GetValue (object value, ResourceProperty property)
37                 {
38                         // LAMESPEC: this method is not implemented in the .NET assembly
39                         throw new NotImplementedException ();
40                 }
41
42                 public static IEnumerable <T> GetSequenceValue<T>  (object value, ResourceProperty property)
43                 {
44                         // LAMESPEC: this method is not implemented in the .NET assembly
45                         throw new NotImplementedException ();
46                 }
47
48                 public static object Convert (object value, ResourceType type)
49                 {
50                         // LAMESPEC: this method is not implemented in the .NET assembly
51                         throw new NotImplementedException ();
52                 }
53
54                 public static bool TypeIs (object value, ResourceType type)
55                 {
56                         // LAMESPEC: this method is not implemented in the .NET assembly
57                         throw new NotImplementedException ();
58                 }
59
60                 public static int Compare (string left, string right)
61                 {
62                         return Comparer <string>.Default.Compare (left, right);
63                 }
64
65                 public static int Compare (bool left, bool right)
66                 {
67                         return Comparer <bool>.Default.Compare (left, right);
68                 }
69
70                 public static int Compare (bool? left, bool? right)
71                 {
72                         return Comparer <bool?>.Default.Compare (left, right);
73                 }       
74
75                 public static int Compare (Guid left, Guid right)
76                 {
77                         return Comparer <Guid>.Default.Compare (left, right);
78                 }
79
80                 public static int Compare (Guid? left, Guid? right)
81                 {
82                         return Comparer <Guid?>.Default.Compare (left, right);
83                 }
84         }
85 }