--- /dev/null
+//
+// AssemblyInfo.cs
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Security;
+using System.Security.Permissions;
+using System.Resources;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("System.Data.Linq.dll")]
+[assembly: AssemblyDescription("System.Data.Linq.dll")]
+[assembly: AssemblyCompany("Mono Development Team")]
+[assembly: AssemblyProduct("System.Query")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyCulture("")]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+[assembly: NeutralResourcesLanguage ("en-US")]
+[assembly: AssemblyInformationalVersion ("")]
+
+[assembly: CLSCompliant(true)]
+[assembly: ComVisible (false)]
+
+[assembly: AssemblyVersion(Consts.FxVersion)]
+[assembly: SatelliteContractVersion (Consts.FxVersion)]
+
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile("../ecma.pub")]
+[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification=true)]
+[assembly: AllowPartiallyTrustedCallers]
+
--- /dev/null
+2007-08-23 Marek Safar <marek.safar@gmail.com>
+
+ * ChangeLog: Updated version info.
+
+2007-03-23 Antonello Provenzano <antonello@deveel.com>
+
+ * ChangeLog: Added
+
--- /dev/null
+2007-08-24 Marek Safar <marek.safar@gmail.com>\r
+\r
+ * System.Data.Linq.dll.sources: Some Beta 2 updates.\r
+ \r
+ * Makefile: Build as 3.5 assembly.\r
+ \r
+2007-08-12 Marek Safar <marek.safar@gmail.com>\r
+\r
+ * System.Data.Linq.dll.sources: Added missing files.\r
+ \r
+2007-03-24 Marek Safar <marek.safar@gmail.com>\r
+\r
+ * Initial commit\r
--- /dev/null
+thisdir = class/System.Dat.Linq\r
+SUBDIRS = \r
+include ../../build/rules.make\r
+\r
+LIBRARY = System.Data.Linq.dll\r
+LIB_MCS_FLAGS = \\r
+ /r:System.dll \\r
+ /r:System.Core.dll \\r
+ /r:System.Data.dll \\r
+ /r:System.Transactions.dll \\r
+ /r:System.Xml.dll \\r
+\r
+NO_TEST = yes\r
+\r
+# This is a .NET 3.5 only assembly\r
+VALID_PROFILE := $(filter net_3_5, $(PROFILE))\r
+ifndef VALID_PROFILE\r
+LIBRARY_NAME = dummy-System.Data.Linq.dll\r
+NO_INSTALL = yes\r
+NO_SIGN_ASSEMBLY = yes\r
+NO_TEST = yes\r
+endif\r
+\r
+include ../../build/library.make\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System;
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
+ public sealed class AssociationAttribute : DataAttribute
+ {
+
+ #region Fields
+ private string deleteRule;
+ private bool fkey;
+ private bool unique;
+ private string otherKey;
+ private string thisKey;
+ bool deleteOnNull;
+ #endregion
+
+ #region Properties
+ public bool DeleteOnNull {
+ get { return deleteOnNull; }
+ set { deleteOnNull = value; }
+ }
+
+ public string DeleteRule
+ {
+ get { return deleteRule; }
+ set { deleteRule = value; }
+ }
+
+ public bool IsForeignKey
+ {
+ get { return fkey; }
+ set { fkey = value; }
+ }
+
+ public bool IsUnique
+ {
+ get { return this.unique; }
+ set { unique = value; }
+ }
+
+ public string OtherKey
+ {
+ get { return this.otherKey; }
+ set { otherKey = value; }
+ }
+
+ public string ThisKey
+ {
+ get { return thisKey; }
+ set { thisKey = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public sealed class AttributeMappingSource : MappingSource
+ {
+ protected internal override MetaModel CreateModel(Type contextType)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+// Marek Safar <marek.safar@gmail.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public enum AutoSync
+ {
+ Default = 0,
+ Always = 1,
+ Never = 2,
+ OnInsert = 3,
+ OnUpdate = 4
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+// Marek Safar <marek.safar@gmail.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
+ public sealed class ColumnAttribute : DataAttribute
+ {
+
+ #region Fields
+ private AutoSync autoSync = ~AutoSync.Never;
+ private bool canBeNull = true;
+ private bool canBeNullSet;
+ private UpdateCheck check = UpdateCheck.Always;
+ private string dbtype;
+ private string expression;
+ private bool dbGen;
+ private bool discrim;
+ private bool pkey;
+ private bool version;
+ #endregion
+
+ #region Properties
+ public AutoSync AutoSync
+ {
+ get { return autoSync; }
+ set { autoSync = value; }
+ }
+
+ public bool CanBeNull
+ {
+ get { return canBeNull; }
+ set
+ {
+ canBeNullSet = true;
+ canBeNull = value;
+ }
+ }
+
+ internal bool CanBeNullSet
+ {
+ get { return canBeNullSet; }
+ }
+
+ public string DbType
+ {
+ get { return dbtype; }
+ set { dbtype = value; }
+ }
+
+ public string Expression
+ {
+ get { return expression; }
+ set { expression = value; }
+ }
+
+ public bool IsDbGenerated
+ {
+ get { return dbGen; }
+ set { dbGen = value; }
+ }
+
+ public bool IsDiscriminator
+ {
+ get { return discrim; }
+ set { discrim = value; }
+ }
+
+ public bool IsPrimaryKey
+ {
+ get { return pkey; }
+ set { pkey = value; }
+ }
+
+ public bool IsVersion
+ {
+ get { return version; }
+ set { version = value; }
+ }
+
+ public UpdateCheck UpdateCheck
+ {
+ get { return check; }
+ set { check = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class DataAttribute : Attribute
+ {
+ #region Fields
+ private string name;
+ private string storage;
+ #endregion
+
+ #region Properties
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+
+ public string Storage
+ {
+ get { return storage; }
+ set { storage = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
+ public sealed class DatabaseAttribute : Attribute
+ {
+ #region Fields
+ private string name;
+ #endregion
+
+ #region Properties
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+// Marek Safar <marek.safar@gmail.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
+ public sealed class FunctionAttribute : Attribute
+ {
+ #region Fields
+ string name;
+ bool is_composable;
+ #endregion
+
+ #region Properties
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+
+ public bool IsComposable {
+ get { return is_composable; }
+ set { is_composable = value; }
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+//
+// InheritanceMappingAttribute.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
+ public sealed class InheritanceMappingAttribute : Attribute
+ {
+ #region Fields
+ object code;
+ bool isDefault;
+ Type type;
+ #endregion
+
+ #region Properties
+ public object Code
+ {
+ get { return code; }
+ set { code = value; }
+ }
+
+ public bool IsDefault {
+ get { return isDefault; }
+ set { isDefault = value; }
+ }
+
+ public Type Type {
+ get { return type; }
+ set { type = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MappingSource
+ {
+ #region Protected Methods
+ protected internal abstract MetaModel CreateModel(Type contextType);
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaAccessor
+ {
+ #region Properties
+ public abstract Type Type { get; }
+ #endregion
+
+ #region Public Methods
+ public abstract object GetBoxedValue(object instance);
+
+ public abstract void SetBoxedValue(ref object instance, object value);
+
+
+ public virtual bool HasAssignedValue(object instance)
+ {
+ return true;
+ }
+
+ public virtual bool HasLoadedValue(object instance)
+ {
+ return false;
+ }
+
+ public virtual bool HasValue(object instance)
+ {
+ return true;
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.ObjectModel;
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaAssociation
+ {
+
+ #region Properties
+ public abstract string DeleteRule { get; }
+
+ public abstract bool IsForeignKey { get; }
+
+ public abstract bool IsMany { get; }
+
+ public abstract bool IsNullable { get; }
+
+ public abstract bool IsUnique { get; }
+
+ public abstract ReadOnlyCollection<MetaDataMember> OtherKey { get; }
+
+ public abstract bool OtherKeyIsPrimaryKey { get; }
+
+ public abstract MetaDataMember OtherMember { get; }
+
+ public abstract MetaType OtherType { get; }
+
+ public abstract ReadOnlyCollection<MetaDataMember> ThisKey { get; }
+
+ public abstract bool ThisKeyIsPrimaryKey { get; }
+
+ public abstract MetaDataMember ThisMember { get; }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Reflection;
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaDataMember
+ {
+ #region Properties
+ public abstract MetaAssociation Association { get; }
+
+ public abstract AutoSync AutoSync { get; }
+
+ public abstract bool CanBeNull { get; }
+
+ public abstract string DbType { get; }
+
+ public abstract MetaAccessor DeferredSourceAccessor { get; }
+
+ public abstract MetaAccessor DeferredValueAccessor { get; }
+
+ public abstract string Expression { get; }
+
+ public abstract bool IsAssociation { get; }
+
+ public abstract bool IsDbGenerated { get; }
+
+ public abstract bool IsDeferred { get; }
+
+ public abstract bool IsDiscriminator { get; }
+
+ public abstract bool IsPersistent { get; }
+
+ public abstract bool IsPrimaryKey { get; }
+
+ public abstract bool IsVersion { get; }
+
+ public abstract string MappedName { get; }
+
+ public abstract MemberInfo Member { get; }
+
+ public abstract MetaAccessor MemberAccessor { get; }
+
+ public abstract MetaType DeclaringType { get; }
+
+ public abstract string Name { get; }
+
+ public abstract int Ordinal { get; }
+
+ public abstract MetaAccessor StorageAccessor { get; }
+
+ public abstract MemberInfo StorageMember { get; }
+
+ public abstract Type Type { get; }
+
+ public abstract UpdateCheck UpdateCheck { get; }
+ #endregion
+
+ #region Public Methods
+ public abstract bool IsDeclaredBy(MetaType type);
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaFunction
+ {
+
+ #region Properties
+ public abstract bool HasMultipleResults { get; }
+
+ public abstract string MappedName { get; }
+
+ public abstract MethodInfo Method { get; }
+
+ public abstract MetaModel Model { get; }
+
+ public abstract string Name { get; }
+
+ public abstract ReadOnlyCollection<MetaParameter> Parameters { get; }
+
+ public abstract MetaParameter ReturnParameter { get; }
+
+ public abstract ReadOnlyCollection<MetaType> ResultRowTypes { get; }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public enum MetaFunctionType
+ {
+ Invalid,
+ StoredProcedure,
+ UserDefinedFunction,
+ TableValuedFunction
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaModel
+ {
+ #region Properties
+ public abstract string DatabaseName { get; }
+
+ public abstract Type ProviderType { get; }
+ #endregion
+
+
+ #region Public Methods
+ public abstract MetaFunction GetFunction(MethodInfo method);
+
+ public abstract IEnumerable<MetaFunction> GetFunctions();
+
+ public abstract MetaTable GetTable(Type rowType);
+
+ public abstract IEnumerable<MetaTable> GetTables();
+
+ public abstract MetaType GetMetaType(Type type);
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Reflection;
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaParameter
+ {
+
+ #region Properties
+ public abstract string DbType { get; }
+
+ public abstract string MappedName { get; }
+
+ public abstract string Name { get; }
+
+ public abstract ParameterInfo Parameter { get; }
+
+ public abstract Type ParameterType { get; }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaTable
+ {
+ #region Properties
+ public abstract MetaModel Model { get; }
+
+ public abstract MetaType RowType { get; }
+
+ public abstract string TableName { get; }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Data.Linq.Mapping
+{
+ public abstract class MetaType
+ {
+ #region Public Methods
+ public abstract MetaDataMember GetDataMember(MemberInfo member);
+
+ public abstract MetaType GetInheritanceType(Type type);
+
+ public abstract MetaType GetTypeForInheritanceCode(object code);
+ #endregion
+
+ #region Properties
+ public abstract ReadOnlyCollection<MetaAssociation> Associations { get; }
+
+ public abstract bool CanInstantiate { get; }
+
+ public abstract ReadOnlyCollection<MetaDataMember> DataMembers { get; }
+
+ public abstract MetaDataMember DBGeneratedIdentityMember { get; }
+
+ public abstract ReadOnlyCollection<MetaType> DerivedTypes { get; }
+
+ public abstract MetaDataMember Discriminator { get; }
+
+ public abstract bool HasInheritance { get; }
+
+ public abstract bool HasInheritanceCode { get; }
+
+ public abstract bool HasUpdateCheck { get; }
+
+ public abstract ReadOnlyCollection<MetaDataMember> IdentityMembers { get; }
+
+ public abstract object InheritanceCode { get; }
+
+ public abstract MetaType InheritanceDefault { get; }
+
+ public abstract MetaType InheritanceRoot { get; }
+
+ public abstract ReadOnlyCollection<MetaType> InheritanceTypes { get; }
+
+ public abstract bool IsEntity { get; }
+
+ public abstract bool IsInheritanceDefault { get; }
+
+ public abstract MetaModel Model { get; }
+
+ public abstract string Name { get; }
+
+ public abstract ReadOnlyCollection<MetaDataMember> PersistentDataMembers { get; }
+
+ public abstract MetaTable Table { get; }
+
+ public abstract Type Type { get; }
+
+ public abstract MetaDataMember VersionMember { get; }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter, AllowMultiple = false)]
+ public sealed class ParameterAttribute : Attribute
+ {
+ #region Fields
+ private string dbType;
+ private string name;
+ #endregion
+
+ #region Properties
+ public string DbType
+ {
+ get { return dbType; }
+ set { dbType = value; }
+ }
+
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
+ public sealed class ProviderAttribute : Attribute
+ {
+ public ProviderAttribute(Type type)
+ {
+ this.type = type;
+ }
+
+ #region Fields
+ private Type type;
+ #endregion
+
+ #region Properties
+ public Type Type
+ {
+ get { return type; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
+ public sealed class ResultTypeAttribute : Attribute
+ {
+ #region .ctor
+ public ResultTypeAttribute(Type type)
+ {
+ this.type = type;
+ }
+ #endregion
+
+ #region Fields
+ private Type type;
+ #endregion
+
+ #region Properties
+ public Type Type
+ {
+ get { return type; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
+ public sealed class TableAttribute : Attribute
+ {
+ #region .ctor
+ public TableAttribute()
+ {
+ }
+ #endregion
+
+ #region Fields
+ private string name;
+ #endregion
+
+ #region Properties
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Mapping
+{
+ public enum UpdateCheck
+ {
+ Always,
+ Never,
+ WhenChanged
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+using System.Data.Linq.Provider;
+using System.IO;
+using System.Xml;
+
+namespace System.Data.Linq.Mapping
+{
+ /// <summary>
+ /// A source that maps against an XML serialization of the
+ /// DLINQ Mapping Schema.
+ /// </summary>
+ public sealed class XmlMappingSource : MappingSource
+ {
+ #region .ctor
+ private XmlMappingSource(XmlDatabaseMapping dbMapping)
+ {
+ this.dbMapping = dbMapping;
+ }
+ #endregion
+
+ #region Fields
+ private XmlDatabaseMapping dbMapping;
+ private Dictionary<Type, MetaModel> models = new Dictionary<Type,MetaModel>();
+ #endregion
+
+ #region Private Static Methods
+ private static bool GetBoolean(string value, bool defaultValue)
+ {
+ if (value == null)
+ return defaultValue;
+
+ try
+ {
+ return Boolean.Parse(value);
+ }
+ catch (FormatException)
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ private static XmlDatabaseMapping ReadDatabaseMapping(XmlReader reader)
+ {
+ XmlDocument doc = new XmlDocument();
+ doc.Load(reader);
+
+ XmlElement dbElement = doc.DocumentElement;
+ if (dbElement.LocalName != "Database")
+ throw new InvalidOperationException();
+
+ string name = dbElement.GetAttribute("Name");
+ if (name == null)
+ throw new InvalidOperationException();
+
+ string providerType = dbElement.GetAttribute("ProviderType");
+
+ XmlDatabaseMapping dbMapping = new XmlDatabaseMapping(name, providerType);
+
+ try
+ {
+ dbMapping = new XmlDatabaseMapping(name, providerType);
+
+ XmlNodeList childNodes = dbElement.ChildNodes;
+
+ for (int i = 0; i < childNodes.Count; i++)
+ {
+ XmlElement child = childNodes[i] as XmlElement;
+ switch (child.LocalName)
+ {
+ case "Table":
+ dbMapping.Tables.Add(ReadTableElement(child));
+ break;
+ case "StoredProcedure":
+ break;
+ case "UserDefinedFunction":
+ break;
+ case "TableValuedFunction":
+ break;
+ }
+ }
+ }
+ catch
+ {
+ dbMapping = null;
+ throw;
+ }
+
+ return dbMapping;
+ }
+
+ private static XmlTableMapping ReadTableElement(XmlElement element)
+ {
+ string name = element.GetAttribute("name");
+ if (name == null || name.Length == 0)
+ throw new InvalidOperationException();
+
+ XmlTableMapping tableMapping = new XmlTableMapping(name);
+
+ XmlNodeList childNodes = element.ChildNodes;
+ for (int i = 0; i < childNodes.Count; i++)
+ {
+ XmlElement child = childNodes[i] as XmlElement;
+ if (child.LocalName != "Type") //ISSUE: should we ignore the case?
+ throw new InvalidOperationException();
+
+ if (tableMapping.RowType != null)
+ throw new InvalidOperationException();
+
+ tableMapping.RowType = ReadTypeElement(child);
+ }
+
+ return tableMapping;
+ }
+
+ private static XmlTypeMapping ReadTypeElement(XmlElement element)
+ {
+ string name = element.GetAttribute("Name");
+ if (name == null || name.Length == 0)
+ throw new InvalidOperationException();
+
+ XmlTypeMapping typeMapping = new XmlTypeMapping(name);
+
+ typeMapping.InheritanceCode = element.GetAttribute("InheritanceCode");
+ typeMapping.IsInheritanceDefault = GetBoolean(element.GetAttribute("IsInheritanceDefault"), false);
+
+ XmlNodeList childNodes = element.ChildNodes;
+ for (int i = 0; i < childNodes.Count; i++)
+ {
+ XmlElement child = childNodes[i] as XmlElement;
+ switch (child.LocalName)
+ {
+ case "Type":
+ typeMapping.Derived.Add(ReadTypeElement(child));
+ break;
+ case "Association":
+ typeMapping.Members.Add(ReadAssociationElement(child));
+ break;
+ case "Column":
+ throw new NotImplementedException ();
+ //typeMapping.Members.Add(ReadColumnElement(child));
+ break;
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+
+ return typeMapping;
+ }
+
+ [MonoTODO]
+ private static XmlMemberMapping ReadAssociationElement(XmlElement element)
+ {
+ string member = element.GetAttribute("Member");
+ if (member == null || member.Length == 0)
+ throw new InvalidOperationException();
+
+ XmlAssociationMapping assMapping = new XmlAssociationMapping(member);
+
+ return assMapping;
+ }
+/*
+ private static XmlColumnMapping ReadColumnElement(XmlElement element)
+ {
+ string member = element.GetAttribute("Member");
+ if (member == null || member.Length == 0)
+ throw new InvalidOperationException();
+
+ XmlColumnMapping columnMapping = new XmlColumnMapping(member);
+ columnMapping.Name = element.GetAttribute("Name");
+ columnMapping.DbType = element.GetAttribute("DbType");
+ columnMapping.IsDBGenerated = GetBoolean(element.GetAttribute("IsDBGenerated"), false);
+ columnMapping.IsDiscriminator = GetBoolean(element.GetAttribute("IsDiscriminator"), false);
+ columnMapping.IsPrimaryKey = GetBoolean(element.GetAttribute("IsPrimaryKey"), false);
+ columnMapping.IsVersion = GetBoolean(element.GetAttribute("IsVersion"), false);
+ columnMapping.Storage = element.GetAttribute("Storage");
+ columnMapping.CanBeNull = GetBoolean(element.GetAttribute("CanBeNull"), false);
+ columnMapping.Expression = element.GetAttribute("Expression");
+
+ string sUpdateCheck = element.GetAttribute("UpdateCheck");
+ if (sUpdateCheck == null)
+ columnMapping.UpdateCheck = UpdateCheck.Always;
+ else
+ columnMapping.UpdateCheck = (UpdateCheck)Enum.Parse(typeof(UpdateCheck), sUpdateCheck, true);
+
+ string sAutoSync = element.GetAttribute("AutoSync");
+ if (sAutoSync == null)
+ columnMapping.AutoSync = AutoSync.Always;
+ else
+ columnMapping.AutoSync = (AutoSync)Enum.Parse(typeof(AutoSync), sAutoSync, true);
+
+ return columnMapping;
+ }
+ */
+ #endregion
+
+ #region Protected Methods
+ protected internal override MetaModel CreateModel(Type contextType)
+ {
+ if (contextType == null)
+ throw new ArgumentNullException("contextType");
+
+ MetaModel model = models[contextType];
+ if (model == null)
+ {
+ //TODO: we have to create it and add it to the dictionary...
+ }
+
+ return model;
+ }
+ #endregion
+
+ #region Public Static Methods
+ public static XmlMappingSource FromStream(Stream stream)
+ {
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ return FromReader(new XmlTextReader(stream));
+ }
+
+ public static XmlMappingSource FromReader(XmlReader reader)
+ {
+ if (reader == null)
+ throw new ArgumentNullException("reader");
+
+ return new XmlMappingSource(ReadDatabaseMapping(reader));
+ }
+
+ public static XmlMappingSource FromUrl(string url)
+ {
+ if (url == null)
+ throw new ArgumentNullException("url");
+
+ return FromReader(new XmlTextReader(url));
+ }
+
+ public static XmlMappingSource FromXml(string xml)
+ {
+ if (xml == null)
+ throw new ArgumentNullException("xml");
+
+ return FromReader(new XmlTextReader(new StringReader(xml)));
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Provider
+{
+ public interface ICompiledQuery
+ {
+ #region Methods
+ object Execute(IProvider provider, object[] arguments);
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Linq;
+using System.Linq.Expressions;
+
+
+namespace System.Data.Linq.Provider
+{
+ public interface IDataServices
+ {/*
+ #region Properties
+ DataContext Context { get; }
+
+ MetaModel Model { get; }
+ #endregion
+
+ #region Methods
+ IQueryable CreateQuery(Type type, Expression expression);
+
+ object GetCachedObject(Expression query);
+
+ object GetCachedObject(MetaType type, object[] keyValues);
+
+ IQueryable GetDataMemberQuery(MetaDataMember member, Expression[] keyValues);
+
+ IQueryable GetDataMemberQuery(MetaDataMember member, object[] keyValues);
+
+ IDeferredSourceFactory GetDeferredSourceFactory(MetaDataMember member);
+
+ object[] GetForeignKeyValues(MetaAssociation association, object instance);
+
+ object[] GetKeyValues(MetaType type, LambdaExpression predicate);
+
+ object[] GetKeyValues(MetaType type, object instance);
+
+ IQueryable GetObjectQuery(MetaType type, Expression[] keyValues);
+
+ IQueryable GetObjectQuery(MetaType type, object[] keyValues);
+
+ object InsertLookupCachedObject(MetaType type, object instance);
+
+ bool IsCachedObject(MetaType type, object instance);
+
+ void OnEntityMaterialized(MetaType type, object instance);
+ #endregion
+ */
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections;
+
+namespace System.Data.Linq.Provider
+{
+ public interface IDeferredSourceFactory
+ {
+ IEnumerable CreateDeferredSource(object instance);
+
+ IEnumerable CreateDeferredSource(object[] keyValues);
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq.Provider
+{
+ public interface IExecuteResults
+ {
+ #region Properties
+ object ReturnValue { get; }
+ #endregion
+
+ #region Methods
+ object GetParameterValue(int parameterIndex);
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq.Provider
+{
+ public interface IMultipleResults : IExecuteResults, IDisposable
+ {
+ #region Methods
+ IEnumerable<T> GetResult<T>();
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections;
+using System.Data;
+using System.IO;
+using System.Linq.Expressions;
+
+namespace System.Data.Linq.Provider
+{
+ public interface IProvider : IDisposable
+ {
+ #region Properties
+ IDbConnection Connection { get; }
+
+ TextWriter Log { get; set; }
+
+ IDbTransaction Transaction { get; set; }
+ #endregion
+
+ #region Methods
+ void ClearConnection();
+
+ ICompiledQuery Compile(Expression query);
+
+ void CreateDatabase();
+
+ bool DatabaseExists();
+
+ void DeleteDatabase();
+
+ IMultipleResults ExecuteMultipleResults(Expression query);
+
+ IExecuteResult ExecuteNonQuery(Expression query);
+
+ IQueryResults ExecuteQuery(Expression query);
+
+ string GetQueryText(Expression query);
+
+ void Initialize(IDataServices dataServices, object connection);
+
+ IEnumerator Translate(Type elementType, IDataReader reader);
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections;
+
+namespace System.Data.Linq.Provider
+{
+ public interface IQueryResults : IExecuteResult, IEnumerable
+ {
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq.Provider
+{
+ public interface IQueryResults<T> : IQueryResults, IEnumerable<T>
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+2007-09-12 Marek Safar <marek.safar@gmail.com>
+
+ * Initial commit
--- /dev/null
+../../build/common/Consts.cs
+../../build/common/MonoTODOAttribute.cs
+Assembly/AssemblyInfo.cs
+System.Data.Linq/Binary.cs
+System.Data.Linq/ChangeConflictCollection.cs
+System.Data.Linq/ChangeConflictException.cs
+System.Data.Linq/ConflictMode.cs
+System.Data.Linq/DataContext.cs
+System.Data.Linq/DataShape.cs
+System.Data.Linq/DuplicateKeyException.cs
+System.Data.Linq/EntityRef.cs
+System.Data.Linq/ForeignKeyReferenceAlreadyHasValueException.cs
+System.Data.Linq/IExecuteResult.cs
+System.Data.Linq/IMultipleResults.cs
+System.Data.Linq/ITable.cs
+System.Data.Linq/Link_T.cs
+System.Data.Linq/MemberChangeConflict.cs
+System.Data.Linq/ObjectChangeConflict.cs
+System.Data.Linq/RefreshMode.cs
+System.Data.Linq/Schema.cs
+System.Data.Linq/Table_T.cs
+System.Data.Linq/XmlAssociationMapping.cs
+System.Data.Linq/XmlColumnMapping.cs
+System.Data.Linq/XmlDatabaseMapping.cs
+System.Data.Linq/XmlMemberMapping.cs
+System.Data.Linq/XmlTableMapping.cs
+System.Data.Linq/XmlTypeMapping.cs
+System.Data.Linq.Provider/ICompiledQuery.cs
+System.Data.Linq.Provider/IDataServices.cs
+System.Data.Linq.Provider/IDeferredSourceFactory.cs
+System.Data.Linq.Provider/IQueryResults.cs
+System.Data.Linq.Provider/IQueryResults_T.cs
+System.Data.Linq.Provider/IProvider.cs
+System.Data.Linq.Mapping/AssociationAttribute.cs
+System.Data.Linq.Mapping/AttributeMappingSource.cs
+System.Data.Linq.Mapping/AutoSync.cs
+System.Data.Linq.Mapping/ColumnAttribute.cs
+System.Data.Linq.Mapping/DataAttribute.cs
+System.Data.Linq.Mapping/DatabaseAttribute.cs
+System.Data.Linq.Mapping/FunctionAttribute.cs
+System.Data.Linq.Mapping/InheritanceMappingAttribute.cs
+System.Data.Linq.Mapping/MappingSource.cs
+System.Data.Linq.Mapping/MetaAccessor.cs
+System.Data.Linq.Mapping/MetaAssociation.cs
+System.Data.Linq.Mapping/MetaFunction.cs
+System.Data.Linq.Mapping/MetaModel.cs
+System.Data.Linq.Mapping/MetaTable.cs
+System.Data.Linq.Mapping/MetaType.cs
+System.Data.Linq.Mapping/MetaDataMember.cs
+System.Data.Linq.Mapping/MetaFunctionType.cs
+System.Data.Linq.Mapping/MetaParameter.cs
+System.Data.Linq.Mapping/ParameterAttribute.cs
+System.Data.Linq.Mapping/ProviderAttribute.cs
+System.Data.Linq.Mapping/ResultTypeAttribute.cs
+System.Data.Linq.Mapping/TableAttribute.cs
+System.Data.Linq.Mapping/UpdateCheck.cs
+System.Data.Linq.Mapping/XmlMappingSource.cs
+
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.IO;
+
+namespace System.Data.Linq
+{
+ public sealed class Binary : IEquatable<Binary>
+ {
+ #region .ctor
+ public Binary(byte[] bytes, int offset, int length)
+ {
+ }
+
+ public Binary(byte[] bytes)
+ : this(bytes, true)
+ {
+ }
+
+ public Binary(byte[] bytes, bool copy)
+ {
+ if (bytes == null)
+ throw new ArgumentNullException("bytes");
+
+ if (copy)
+ {
+ this.bytes = new byte[bytes.Length];
+ Array.Copy(bytes, this.bytes, bytes.Length);
+ }
+ else
+ {
+ this.bytes = bytes;
+ }
+ }
+ #endregion
+
+ #region Fields
+ private byte[] bytes;
+
+ private static Binary emptyBin;
+ #endregion
+
+ #region Properties
+ public int Length
+ {
+ get { return bytes.Length; }
+ }
+
+ public byte this[int index]
+ {
+ get { return bytes[index]; }
+ }
+
+ public static Binary Empty
+ {
+ get
+ {
+ if (emptyBin == null)
+ emptyBin = new Binary(new byte[0], 0, 0);
+ return emptyBin;
+ }
+ }
+ #endregion
+
+ #region Operators
+ public static bool operator ==(Binary binary1, Binary binary2)
+ {
+ if (binary1 == null && binary2 == null)
+ return true;
+ if (binary1 == null && binary2 != null)
+ return false;
+ return binary1.Equals(binary2);
+ }
+
+ public static bool operator !=(Binary binary1, Binary binary2)
+ {
+ return !(binary1 == binary2);
+ }
+
+ public static implicit operator Binary(byte[] bytes)
+ {
+ return new Binary(bytes);
+ }
+ #endregion
+
+ #region Public Methods
+
+ public bool Equals(Binary other)
+ {
+ return Equals(other);
+ }
+
+ public override bool Equals(object obj)
+ {
+ //TODO:
+ return base.Equals(obj);
+ }
+
+ public override int GetHashCode()
+ {
+ //TODO:
+ return base.GetHashCode();
+ }
+
+ public void CopyTo(int position, byte[] buffer, int offset, int length)
+ {
+ Array.Copy(this.bytes, position, buffer, offset, length);
+ }
+
+ public byte[] ToArray()
+ {
+ return (byte[])bytes.Clone();
+ }
+
+ public Stream ToStream()
+ {
+ return new MemoryStream(bytes, false);
+ }
+
+ public override string ToString()
+ {
+ //TODO:
+ return base.ToString();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System.Data.Linq
+{
+ public sealed class ChangeConflictCollection : ICollection<ObjectChangeConflict>, ICollection
+ {
+ #region .ctor
+ internal ChangeConflictCollection()
+ {
+ list = new List<ObjectChangeConflict>();
+ }
+ #endregion
+
+ #region Fields
+ private List<ObjectChangeConflict> list;
+ #endregion
+
+ #region Properties
+
+ public int Count
+ {
+ get { return list.Count; }
+ }
+
+ public ObjectChangeConflict this[int index]
+ {
+ get { return list[index]; }
+ }
+
+ #endregion
+
+ #region ICollection<ObjectChangeConflict> Implementations
+ bool ICollection<ObjectChangeConflict>.IsReadOnly
+ {
+ get { return true; }
+ }
+
+ void ICollection<ObjectChangeConflict>.Add(ObjectChangeConflict item)
+ {
+ throw new NotSupportedException();
+ }
+
+ void ICollection.CopyTo(Array array, int index)
+ {
+ CopyTo((ObjectChangeConflict[])array, index);
+ }
+ #endregion
+
+ #region IEnumerable Implementations
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return list.GetEnumerator();
+ }
+
+ #endregion
+
+ #region ICollection Implementations
+ bool ICollection.IsSynchronized
+ {
+ get { return false; }
+ }
+
+ object ICollection.SyncRoot
+ {
+ get { return null; }
+ }
+ #endregion
+
+ #region Public Methods
+
+ public void Clear()
+ {
+ list.Clear();
+ }
+
+ public bool Contains(ObjectChangeConflict item)
+ {
+ return list.Contains(item);
+ }
+
+ public void CopyTo(ObjectChangeConflict[] array, int arrayIndex)
+ {
+ list.CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(ObjectChangeConflict item)
+ {
+ return list.Remove(item);
+ }
+
+ public IEnumerator<ObjectChangeConflict> GetEnumerator()
+ {
+ return list.GetEnumerator();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+namespace System.Data.Linq
+{
+ public class ChangeConflictException : Exception
+ {
+ public ChangeConflictException()
+ {
+ }
+
+ public ChangeConflictException(string message)
+ : base(message)
+ {
+ }
+
+ public ChangeConflictException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+2007-08-24 Marek Safar <marek.safar@gmail.com>
+
+ * *.cs: Some Beta 2 updates.
+
+2007-03-29 Antonello Provenzano <antonello@deveel.com>
+
+ * DataContext.cs: implementations
+ * DataShape.cs: New file
+ * IDataServices.cs: New file
+
+2007-03-24 Antonello Provenzano <antonello@deveel.com>
+
+ * Initial commit
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Linq;
+using System.Linq.Expressions;
+
+namespace System.Data.Linq
+{
+ public sealed class CompiledQuery
+ {
+ #region Fields
+ private LambdaExpression expression;
+ #endregion
+
+ #region Properties
+ public LambdaExpression Expression
+ {
+ get { return expression; }
+ }
+ #endregion
+
+ public static Func<TArg0, TResult> Compile<TArg0, TResult>(Expression<Func<TArg0, TResult>> query) where TArg0 : DataContext
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Func<TArg0, TArg1, TResult> Compile<TArg0, TArg1, TResult>(Expression<Func<TArg0, TArg1, TResult>> query) where TArg0 : DataContext
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Func<TArg0, TArg1, TArg2, TResult> Compile<TArg0, TArg1, TArg2, TResult>(Expression<Func<TArg0, TArg1, TArg2, TResult>> query) where TArg0 : DataContext
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Func<TArg0, TArg1, TArg2, TArg3, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TResult>> query) where TArg0 : DataContext
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ public enum ConflictMode
+ {
+ FailOnFirstConflict,
+ ContinueOnConflict
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections;
+using System.Collections.Generic;
+using System.Data.Linq.Mapping;
+using System.Data.Linq.Provider;
+using System.IO;
+using System.Linq;
+
+namespace System.Data.Linq
+{
+ public class DataContext : IDisposable
+ {
+ #region .ctor
+ public DataContext(IDbConnection connection, MappingSource mapping)
+ {
+ if (connection == null)
+ throw new ArgumentNullException("connection");
+ if (connection == null)
+ throw new ArgumentNullException("mapping");
+
+ this.conflicts = new ChangeConflictCollection();
+ this.mapping = mapping;
+
+ //TODO: init the IDataServices for the provider...
+
+ MetaModel model = mapping.CreateModel(GetType());
+ Type providerType = model.ProviderType;
+
+ if (providerType == null)
+ throw new InvalidOperationException();
+ if (!typeof(IProvider).IsAssignableFrom(providerType))
+ throw new InvalidOperationException();
+
+ provider = (IProvider)Activator.CreateInstance(providerType, true);
+ provider.Initialize(services, connection);
+ }
+
+ public DataContext(IDbConnection connection)
+ : this(connection, new AttributeMappingSource())
+ {
+ }
+
+ ~DataContext()
+ {
+ Dispose(false);
+ }
+ #endregion
+
+ #region Fields
+ private bool disposed;
+ private IProvider provider;
+ private MappingSource mapping;
+ private bool objectTracking;
+ private bool deferredLoading;
+ private DataShape shape;
+ private IDataServices services;
+ private ChangeConflictCollection conflicts;
+ #endregion
+
+ #region Properties
+
+ public ChangeConflictCollection ChangeConflicts
+ {
+ get
+ {
+ CheckIsDisposed();
+ return conflicts;
+ }
+ }
+
+ public IDbConnection Connection
+ {
+ get
+ {
+ CheckIsDisposed();
+ return provider.Connection;
+ }
+ }
+
+ public TextWriter Log
+ {
+ get
+ {
+ CheckIsDisposed();
+ return provider.Log;
+ }
+ set
+ {
+ CheckIsDisposed();
+ provider.Log = value;
+ }
+ }
+
+ public bool ObjectTrackingEnabled
+ {
+ get
+ {
+ CheckIsDisposed();
+ return objectTracking;
+ }
+ set
+ {
+ CheckIsDisposed();
+ objectTracking = value;
+ if (!value)
+ deferredLoading = false;
+ }
+ }
+ #endregion
+
+ #region Private Methods
+ private void CheckIsDisposed()
+ {
+ if (disposed)
+ throw new ObjectDisposedException(GetType().Name);
+ }
+ #endregion
+
+ #region Protected Methods
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (provider != null)
+ {
+ provider.Dispose();
+ provider = null;
+ }
+ mapping = null;
+ shape = null;
+ }
+ }
+ #endregion
+
+ #region Public Methods
+ public void CreateDatabase()
+ {
+ CheckIsDisposed();
+ provider.CreateDatabase();
+ }
+
+ public bool DatabaseExists()
+ {
+ CheckIsDisposed();
+ return provider.DatabaseExists();
+ }
+
+ public void DeleteDatabase()
+ {
+ CheckIsDisposed();
+ provider.DeleteDatabase();
+ }
+
+ public void Dispose()
+ {
+ this.disposed = true;
+ this.Dispose(true);
+ }
+
+ public string GetQueryText(IQueryable query)
+ {
+ CheckIsDisposed();
+ if (query == null)
+ throw new ArgumentNullException("query");
+
+ return provider.GetQueryText(query.Expression);
+ }
+
+ public IEnumerable<T> Translate<T>(IDataReader reader)
+ {
+ CheckIsDisposed();
+ if (reader == null)
+ throw new ArgumentNullException("reader");
+
+ IEnumerator en = provider.Translate(typeof(T), reader);
+ while (en.MoveNext())
+ yield return (T)en.Current;
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ public sealed class DataShape
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ public class DuplicateKeyException : InvalidOperationException
+ {
+ #region .ctor
+ public DuplicateKeyException()
+ {
+ }
+
+ public DuplicateKeyException(string message)
+ : base(message)
+ {
+ }
+
+ public DuplicateKeyException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq
+{
+ //TODO: this should be checked: is LINQ working to handle this?
+ public struct EntityRef<TEntity> where TEntity : class
+ {
+ #region .ctor
+ [MonoTODO()]
+ public EntityRef(TEntity entity)
+ {
+ this.source = null; //TODO: we should assign it...
+ this.entity = entity;
+ }
+
+ public EntityRef(IEnumerable<TEntity> source)
+ {
+ this.source = source;
+ entity = default(TEntity);
+ }
+
+ public EntityRef(EntityRef<TEntity> entityRef)
+ {
+ source = entityRef.source;
+ entity = entityRef.entity;
+ }
+ #endregion
+
+ #region Fields
+ private IEnumerable<TEntity> source;
+ private TEntity entity;
+ #endregion
+
+ #region Properties
+ public TEntity Entity
+ {
+ get { return entity; }
+ set { entity = value; }
+ }
+
+ [MonoTODO()]
+ public bool HasLoadedOrAssignedValue
+ {
+ get { return true; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ public class ForeignKeyReferenceAlreadyHasValueException : InvalidOperationException
+ {
+ public ForeignKeyReferenceAlreadyHasValueException()
+ {
+ }
+
+ public ForeignKeyReferenceAlreadyHasValueException(string message)
+ : base(message)
+ {
+ }
+
+ public ForeignKeyReferenceAlreadyHasValueException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ public interface IExecuteResult
+ {
+ #region Properties
+ object ReturnValue { get; }
+ #endregion
+
+ #region Methods
+ object GetParameterValue(int parameterIndex);
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq
+{
+ public interface IMultipleResults : IDisposable
+ {
+ #region Methods
+ IEnumerable<TElement> GetResult<TElement>();
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections;
+using System.Linq;
+
+namespace System.Data.Linq
+{
+ public interface ITable : IQueryable, IEnumerable
+ {
+ DataContext Context { get; }
+
+ string Name { get; }
+
+ Type RowType { get; }
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq
+{
+ public struct Link<T>
+ {
+ #region .ctor
+ public Link(T value)
+ {
+ this.value = value;
+ source = null;
+ }
+
+ internal Link(IEnumerable<T> source)
+ {
+ this.source = source;
+ this.value = default(T);
+ }
+
+ internal Link(Link<T> link)
+ {
+ value = link.value;
+ source = link.source;
+ }
+ #endregion
+
+ #region Fields
+ private T value;
+ private IEnumerable<T> source;
+ #endregion
+
+ #region Properties
+ //TODO:
+ public bool HasValue
+ {
+ get { return true; }
+ }
+
+ public T Value
+ {
+ get { return value; }
+ set { this.value = value; }
+ }
+
+ internal bool HasLoadedValue
+ {
+ get { return false; }
+ }
+
+ internal bool HasAssignedValue
+ {
+ get { return false; }
+ }
+
+ internal T UnderlyingValue
+ {
+ get { return value; }
+ }
+
+ internal IEnumerable<T> Source
+ {
+ get { return source; }
+ }
+
+ //TODO:
+ internal bool HasSource
+ {
+ get { return false; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Reflection;
+
+namespace System.Data.Linq
+{
+ public sealed class MemberChangeConflict
+ {
+ #region .ctor
+ internal MemberChangeConflict()
+ {
+ }
+ #endregion
+
+ #region Fields
+ private object currentValue;
+ private object databaseValue;
+ private bool resolved;
+ private bool modified;
+ private object originalValue;
+ #endregion
+
+ #region Properties
+ //TODO:
+ public object CurrentValue
+ {
+ get { return currentValue; }
+ }
+
+ //TODO:
+ public object DatabaseValue
+ {
+ get { return databaseValue; }
+ }
+
+ //TODO:
+ public bool IsModified
+ {
+ get { return modified; }
+ }
+
+ //TODO:
+ public bool IsResolved
+ {
+ get { return resolved; }
+ }
+
+ //TODO:
+ public MemberInfo Member
+ {
+ get { return null; }
+ }
+
+ //TODO:
+ public object OriginalValue
+ {
+ get { return originalValue; }
+ }
+ #endregion
+
+ #region Public Methods
+ public void Resolve(RefreshMode refreshMode)
+ {
+ //TODO:
+ }
+
+ public void Resolve(object value)
+ {
+ //TODO:
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.ObjectModel;
+
+namespace System.Data.Linq
+{
+ public sealed class ObjectChangeConflict
+ {
+ #region Fields
+ private bool deleted;
+ private bool resolved;
+ #endregion
+
+ #region Properties
+ //TODO:
+ public bool IsDeleted
+ {
+ get { return deleted; }
+ }
+
+ //TODO:
+ public bool IsResolved
+ {
+ get { return resolved; }
+ }
+
+ //TODO:
+ public ReadOnlyCollection<MemberChangeConflict> MemberConflicts
+ {
+ get { return null; }
+ }
+
+ //TODO:
+ public object Object
+ {
+ get { return null; }
+ }
+
+ //TODO:
+ public ITable Table
+ {
+ get { return null; }
+ }
+ #endregion
+
+ #region Public Methods
+ public void Resolve()
+ {
+ //TODO: check this...
+ Resolve(RefreshMode.KeepCurrentValues, true);
+ }
+
+ public void Resolve(RefreshMode refreshMode)
+ {
+ Resolve(refreshMode, false);
+ }
+
+ public void Resolve(RefreshMode refreshMode, bool autoResolveDeletes)
+ {
+ //TODO:
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ public enum RefreshMode
+ {
+ KeepCurrentValues,
+ KeepChanges,
+ OverwriteCurrentValues
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Data.Linq.Provider;
+using System.Reflection;
+
+namespace System.Data.Linq
+{
+ public abstract class Schema
+ {
+ protected Schema(DataContext context)
+ {
+ if (context == null)
+ throw new ArgumentNullException("context");
+ this.context = context;
+ }
+
+ #region Fields
+ private DataContext context;
+ #endregion
+
+ #region Properties
+ public DataContext Context
+ {
+ get { return context; }
+ }
+ #endregion
+
+ #region Protected Methods
+ protected IExecuteResult ExecuteMethodCall(object instance, MethodInfo methodInfo, params object[] parameters)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ protected IQueryResults<T> ExecuteMethodCall<T>(object instance, MethodInfo methodInfo, params object[] parameters)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ protected IMultipleResults ExecuteMethodCallWithMultipleResults(object instance, MethodInfo methodInfo, params object[] parameters)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data.Linq.Mapping;
+using System.Linq;
+using System.Linq.Expressions;
+
+namespace System.Data.Linq
+{
+ public sealed class Table<T> : IQueryable<T>, IEnumerable<T>, ITable, IQueryable, IEnumerable, IListSource
+ {
+ #region .ctor
+ public Table(DataContext context, MetaTable metaTable)
+ {
+ this.context = context;
+ this.metaTable = metaTable;
+ }
+ #endregion
+
+ #region Fields
+ private DataContext context;
+ private MetaTable metaTable;
+ #endregion
+
+ #region Properties
+ public DataContext Context
+ {
+ get { return context; }
+ }
+
+ //TODO:
+ public bool IsReadOnly
+ {
+ get { return false; }
+ }
+
+ //TODO: check this... is this right?
+ public string Name {
+ get { return metaTable.TableName; }
+ }
+
+ //TODO: check this... is this right?
+ public Type RowType
+ {
+ get { return typeof(T); }
+ }
+ #endregion
+
+ #region IListSource Implementations
+ bool IListSource.ContainsListCollection
+ {
+ get { return false; }
+ }
+
+ IList IListSource.GetList()
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+ #endregion
+
+ #region IQueryable Implementations
+ //TODO: check this... is this right?
+ Type IQueryable.ElementType
+ {
+ get { return typeof(T); }
+ }
+
+ //TODO:
+ Expression IQueryable.Expression
+ {
+ get { return null; }
+ }
+
+ public IQueryProvider Provider {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ #endregion
+
+ #region ICollection Implementations
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return this.GetEnumerator();
+ }
+ #endregion
+
+ #region Public Methods
+ public void Add(T item)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ public void Attach(T item)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ public void Remove(T item)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ public void RemoveAll(IEnumerable<T> items)
+ {
+ //TODO:
+ throw new NotImplementedException();
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ #endregion
+ }
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ class XmlAssociationMapping : XmlMemberMapping
+ {
+ #region .ctor
+ public XmlAssociationMapping(string member)
+ : base(member)
+ {
+ }
+ #endregion
+
+ #region Fields
+ private string deleteRule;
+ private bool foreignKey;
+ private bool unique;
+ private string otherKey;
+ private string otherTableName;
+ private string thisKey;
+ #endregion
+
+ #region Properties
+ public string DeleteRule
+ {
+ get { return deleteRule; }
+ set { deleteRule = value; }
+ }
+
+ public bool IsForeignKey
+ {
+ get { return foreignKey; }
+ set { foreignKey = value; }
+ }
+
+ public bool IsUnique
+ {
+ get { return unique; }
+ set { unique = value; }
+ }
+
+ public string OtherKey
+ {
+ get { return otherKey; }
+ set { otherKey = value; }
+ }
+
+ public string OtherTableName
+ {
+ get { return otherTableName; }
+ set { otherTableName = value; }
+ }
+
+ public string ThisKey
+ {
+ get { return thisKey; }
+ set { thisKey = value; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{/*
+ class XmlColumnMapping : XmlMemberMapping
+ {
+ #region .ctor
+ public XmlColumnMapping(string member)
+ : base(member)
+ {
+ }
+ #endregion
+
+ #region Fields
+ private AutoSync autoSync;
+ private bool? canBeNull;
+ private string dbType;
+ private string expression;
+ private bool dbGenerated;
+ private bool discriminator;
+ private bool primaryKey;
+ private bool version;
+ private UpdateCheck updateCheck;
+ #endregion
+
+ #region Properties
+ public AutoSync AutoSync
+ {
+ get { return autoSync; }
+ set { autoSync = value; }
+ }
+
+ public bool? CanBeNull
+ {
+ get { return canBeNull; }
+ set { canBeNull = value; }
+ }
+
+ public string DbType
+ {
+ get { return dbType; }
+ set { dbType = value; }
+ }
+
+ public string Expression
+ {
+ get { return expression; }
+ set { expression = value; }
+ }
+
+ public bool IsDBGenerated
+ {
+ get { return dbGenerated; }
+ set { dbGenerated = value; }
+ }
+
+ public bool IsDiscriminator
+ {
+ get { return discriminator; }
+ set { discriminator = value; }
+ }
+
+ public bool IsPrimaryKey
+ {
+ get { return primaryKey; }
+ set { primaryKey = value; }
+ }
+
+ public bool IsVersion
+ {
+ get { return version; }
+ set { version = value; }
+ }
+
+ public UpdateCheck UpdateCheck
+ {
+ get { return updateCheck; }
+ set { updateCheck = value; }
+ }
+ #endregion
+ }
+ */
+}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq
+{
+ /// <summary>
+ /// A class that represents the element "Database" in the
+ /// XML schema of a map to a database.
+ /// </summary>
+ class XmlDatabaseMapping
+ {
+ #region .ctor
+ public XmlDatabaseMapping(string name, string providerType)
+ {
+ this.name = name;
+ this.providerType = providerType;
+ }
+ #endregion
+
+ #region Fields
+ private string name;
+ private string providerType;
+ private List<XmlTableMapping> tables;
+ #endregion
+
+ #region Properties
+ public string Name
+ {
+ get { return name; }
+ }
+
+ public string ProviderType
+ {
+ get { return providerType; }
+ }
+
+ public List<XmlTableMapping> Tables
+ {
+ get { return tables; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ class XmlMemberMapping
+ {
+ #region .ctor
+ protected XmlMemberMapping(string member)
+ {
+ this.member = member;
+ }
+ #endregion
+
+ #region Fields
+ private string member;
+ private string name;
+ private string storage;
+ #endregion
+
+ #region Properties
+ public string MemberName
+ {
+ get { return member; }
+ }
+
+ public string Name
+ {
+ get { return name; }
+ set { name = value; }
+ }
+
+ public string Storage
+ {
+ get { return storage; }
+ set { storage = value; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+namespace System.Data.Linq
+{
+ class XmlTableMapping
+ {
+ #region .ctor
+ public XmlTableMapping(string name)
+ {
+ this.name = name;
+ }
+ #endregion
+
+ #region Fields
+ private string name;
+ private XmlTypeMapping rowType;
+ #endregion
+
+ #region Properties
+ public string Name
+ {
+ get { return name; }
+ }
+
+ public XmlTypeMapping RowType
+ {
+ get { return rowType; }
+ set { rowType = value; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//
+// Authors:
+// Antonello Provenzano <antonello@deveel.com>
+//
+
+using System.Collections.Generic;
+
+namespace System.Data.Linq
+{
+ class XmlTypeMapping
+ {
+ #region .ctor
+ public XmlTypeMapping(string name)
+ {
+ this.name = name;
+ }
+ #endregion
+
+ #region Fields
+ private string name;
+ private string inheritanceCode;
+ private bool inheritanceDefault;
+ private List<XmlTypeMapping> derived = new List<XmlTypeMapping>();
+ private List<XmlMemberMapping> members = new List<XmlMemberMapping>();
+ #endregion
+
+ #region Properties
+ public string TypeName
+ {
+ get { return name; }
+ }
+
+ public string InheritanceCode
+ {
+ get { return inheritanceCode; }
+ set { inheritanceCode = value; }
+ }
+
+ public bool IsInheritanceDefault
+ {
+ get { return inheritanceDefault; }
+ set { inheritanceDefault = value; }
+ }
+
+ public List<XmlTypeMapping> Derived
+ {
+ get { return derived; }
+ }
+
+ public List<XmlMemberMapping> Members
+ {
+ get { return members; }
+ }
+ #endregion
+ }
+}
\ No newline at end of file