2008-11-12 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Data.Linq / src / DbLinq / Data / Linq / ITable.cs
1 #region MIT license\r
2 // \r
3 // MIT license\r
4 //\r
5 // Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne\r
6 // \r
7 // Permission is hereby granted, free of charge, to any person obtaining a copy\r
8 // of this software and associated documentation files (the "Software"), to deal\r
9 // in the Software without restriction, including without limitation the rights\r
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
11 // copies of the Software, and to permit persons to whom the Software is\r
12 // furnished to do so, subject to the following conditions:\r
13 // \r
14 // The above copyright notice and this permission notice shall be included in\r
15 // all copies or substantial portions of the Software.\r
16 // \r
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
23 // THE SOFTWARE.\r
24 // \r
25 #endregion\r
26 \r
27 using System.Collections;\r
28 using System.Data.Linq;\r
29 using System.Linq;\r
30 \r
31 #if MONO_STRICT\r
32 namespace System.Data.Linq\r
33 #else\r
34 namespace DbLinq.Data.Linq\r
35 #endif\r
36 {\r
37     public partial interface ITable : IEnumerable, IQueryable\r
38     {\r
39         /// <summary>\r
40         /// Gets the context.\r
41         /// </summary>\r
42         /// <value>The context.</value>\r
43         DataContext Context { get; }\r
44         /// <summary>\r
45         /// Gets a value indicating whether this instance is read only.\r
46         /// </summary>\r
47         /// <value>\r
48         ///     <c>true</c> if this instance is read only; otherwise, <c>false</c>.\r
49         /// </value>\r
50         bool IsReadOnly { get; }\r
51         /// <summary>\r
52         /// Attaches the specified entity.\r
53         /// </summary>\r
54         /// <param name="entity">The entity.</param>\r
55         void Attach(object entity);\r
56         /// <summary>\r
57         /// Attaches the specified entity.\r
58         /// </summary>\r
59         /// <param name="entity">The entity.</param>\r
60         /// <param name="asModified">if set to <c>true</c> [as modified].</param>\r
61         void Attach(object entity, bool asModified);\r
62         /// <summary>\r
63         /// Attaches the specified entity.\r
64         /// </summary>\r
65         /// <param name="entity">The entity.</param>\r
66         /// <param name="original">The original.</param>\r
67         void Attach(object entity, object original);\r
68         /// <summary>\r
69         /// Attaches all entities.\r
70         /// </summary>\r
71         /// <param name="entities">The entities.</param>\r
72         void AttachAll(IEnumerable entities);\r
73         /// <summary>\r
74         /// Attaches all entites.\r
75         /// </summary>\r
76         /// <param name="entities">The entities.</param>\r
77         /// <param name="asModified">if set to <c>true</c> [as modified].</param>\r
78         void AttachAll(IEnumerable entities, bool asModified);\r
79         /// <summary>\r
80         /// Marks entities as to be deleted.\r
81         /// </summary>\r
82         /// <param name="entities">The entities.</param>\r
83         void DeleteAllOnSubmit(IEnumerable entities);\r
84         /// <summary>\r
85         /// Marks entity as to be deleted.\r
86         /// </summary>\r
87         /// <param name="entity">The entity.</param>\r
88         void DeleteOnSubmit(object entity);\r
89         /// <summary>\r
90         /// Gets the modified members.\r
91         /// </summary>\r
92         /// <param name="entity">The entity.</param>\r
93         /// <returns></returns>\r
94         ModifiedMemberInfo[] GetModifiedMembers(object entity);\r
95         /// <summary>\r
96         /// Gets the state of the original entity.\r
97         /// </summary>\r
98         /// <param name="entity">The entity.</param>\r
99         /// <returns></returns>\r
100         object GetOriginalEntityState(object entity);\r
101         /// <summary>\r
102         /// Marks all entities to be inserted.\r
103         /// </summary>\r
104         /// <param name="entities">The entities.</param>\r
105         void InsertAllOnSubmit(IEnumerable entities);\r
106         /// <summary>\r
107         /// Marks entity to be inserted.\r
108         /// </summary>\r
109         /// <param name="entity">The entity.</param>\r
110         void InsertOnSubmit(object entity);\r
111     }\r
112 }\r