├── .gitignore
├── Shared
└── OpenNETCF.ORM.Version.cs
├── Samples
├── SQLiteNorthwind
│ ├── northwind.db
│ ├── app.config
│ ├── packages.config
│ ├── SQLiteNorthwind.csproj.vspscc
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Program.cs
│ └── Entities
│ │ └── Regions.cs
├── ReferenceSample
│ ├── DataStore.cs
│ ├── ReferenceSample.FFx.csproj.vspscc
│ ├── Entities
│ │ ├── Person.cs
│ │ ├── Book.cs
│ │ └── Customer.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
└── ImageSample
│ ├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ └── AssemblyInfo.cs
│ ├── ImageSample.csproj.vspscc
│ ├── Program.cs
│ └── DataClass.cs
├── SQLite
├── targets
│ ├── linux-arm
│ │ ├── SQLite.Interop.dll
│ │ ├── libSQLite.Interop.so
│ │ └── System.Data.SQLite.dll
│ ├── linux-arm64
│ │ ├── SQLite.Interop.dll
│ │ ├── libSQLite.Interop.so
│ │ └── System.Data.SQLite.dll
│ └── readme.md
├── SQLiteException.cs
└── OpenNETCF.ORM.SQLite.csproj
├── Tests
├── OpenNETCF.ORM.SqlCE.Integration.Test
│ ├── Test References
│ │ └── OpenNETCF.ORM.SqlCe.accessor
│ ├── typetest.sdf
│ ├── OpenNETCF.ORM.SqlCE.Integration.Test.csproj.vspscc
│ ├── Entities
│ │ ├── SeekItem.cs
│ │ ├── Book.cs
│ │ ├── Author.cs
│ │ ├── TestTable.cs
│ │ └── CustomObject.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── BinaryData.cs
│ ├── ReplicationTests.cs
│ └── ExtensionTests.cs
├── OpenNETCF.ORM.SQLite.Integration.Test
│ ├── SQLite.Interop.dll
│ ├── OpenNETCF.ORM.SQLite.Integration.Test.csproj.vspscc
│ ├── packages.config
│ └── OpenNETCF.ORM.SQLite.Core.Integration.Test.csproj
├── OpenNETCF.ORM.TestHarness.Android
│ ├── Resources
│ │ ├── Drawable
│ │ │ └── Icon.png
│ │ ├── Values
│ │ │ └── Strings.xml
│ │ ├── Layout
│ │ │ └── Main.axml
│ │ ├── Resource.Designer.cs
│ │ └── AboutResources.txt
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── OpenNETCF.ORM.TestHarness.Android.csproj.vspscc
│ └── Assets
│ │ └── AboutAssets.txt
├── OpenNETCF.ORM.SqlServer.Integration.Test
│ ├── packages.config
│ ├── OpenNETCF.ORM.SqlServer.Integration.Test.csproj.vspscc
│ ├── Entities
│ │ ├── SeekItem.cs
│ │ ├── Author.cs
│ │ ├── GuidItem.cs
│ │ ├── PublishedTenantBuildingState.cs
│ │ ├── Book.cs
│ │ ├── PublishedTenantApartmentState.cs
│ │ ├── PublishedEntityBase.cs
│ │ ├── TestTable.cs
│ │ └── CustomObject.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── OpenNETCF.ORM.Test
│ ├── OpenNETCF.ORM.Test.CF.csproj.vspscc
│ ├── Program.cs
│ ├── Entities
│ │ ├── Author.cs
│ │ ├── Book.cs
│ │ ├── TestTable.cs
│ │ └── CustomObject.cs
│ ├── ITestClass.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── OpenNETCF.ORM.Unit.Test
│ ├── OpenNETCF.ORM.Unit.Test.csproj.vspscc
│ └── Properties
│ │ └── AssemblyInfo.cs
├── OpenNETCF.ORM.Validation
│ ├── OpenNETCF.ORM.Validation.csproj.vspscc
│ ├── SQLCEValidator.cs
│ ├── SQLiteValidator.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── TestItem.cs
├── OpenNETCF.ORM.MySQL.Integration.Test
│ ├── OpenNETCF.ORM.MySQL.Integration.Test.csproj.vspscc
│ ├── Entities
│ │ ├── SeekItem.cs
│ │ ├── Author.cs
│ │ ├── Book.cs
│ │ ├── TestTable.cs
│ │ └── CustomObject.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
└── OpenNETCF.ORM.Oracle.Integration.Test
│ ├── OpenNETCF.ORM.Oracle.Integration.Test.csproj.vspscc
│ ├── Entities
│ ├── SeekItem.cs
│ ├── Author.cs
│ ├── Book.cs
│ ├── TestTable.cs
│ └── CustomObject.cs
│ └── Properties
│ └── AssemblyInfo.cs
├── EntityGenerator
├── ThirdParty
│ └── OpenNETCF
│ │ ├── OpenNETCF.IoC.dll
│ │ └── OpenNETCF.IoC.UI.dll
├── Constants
│ ├── Delegates.cs
│ ├── WizardStep.cs
│ └── EventNames.cs
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ └── AssemblyInfo.cs
├── EntityGenerator.csproj.vspscc
├── Views
│ ├── IWizardView.cs
│ ├── EditEntitiesView.cs
│ ├── WizardViewBase.cs
│ └── EditEntitiesView.Designer.cs
├── Entities
│ ├── IDataSource.cs
│ └── EntityInfo.cs
├── Program.cs
└── Dialogs
│ └── GetPasswordDialog.cs
├── Core
├── packages.config
├── Interfaces
│ ├── ITableEntity.cs
│ ├── IDefaultValue.cs
│ ├── ITableBasedStore.cs
│ ├── IEntityInfo.cs
│ └── ISQLBasedStore.cs
├── Compatability
│ ├── DbDataReader.cs
│ ├── DbConnection.cs
│ ├── DbParameter.cs
│ ├── IDataParameter.cs
│ ├── DbType.cs
│ └── DbCommand.cs
├── Replication
│ ├── ReplicationPriority.cs
│ ├── ReplicationBehavior.cs
│ └── ReplicatorCollection.cs
├── SQL Store Base
│ ├── SqlFilterCondition.cs
│ ├── ConnectionBehavior.cs
│ └── SqlEntityInfo.cs
├── Constants
│ ├── DefaultType.cs
│ └── FieldSearchOrder.cs
├── Entity.cs
├── Phone Compatibility
│ ├── DbParameter.cs
│ ├── DbConnection.cs
│ ├── DbDataReader.cs
│ ├── DbCommand.cs
│ └── DbType.cs
├── KeyScheme.cs
├── Attributes
│ ├── EntityAttribute.cs
│ └── ReferenceAttributeCollection.cs
├── SqlDateTimeDefault.cs
├── Dynamics
│ ├── FieldValue.cs
│ ├── DynamicEntity.cs
│ └── DynamicEntityDefinition.cs
├── FilterCondition.cs
├── Properties
│ └── AssemblyInfo.cs
├── EntityInfo.cs
├── EventArgs.cs
└── OpenNETCF.ORM.csproj
├── Oracle
├── packages.config
├── ODAC
│ └── x86
│ │ └── readme.txt
├── OracleConnectionInfo.cs
└── Properties
│ └── AssemblyInfo.cs
├── SQL Compact
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
└── SqlCeDataStore_Delete.cs
├── SQL Server
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── SqlConnectionInfo.cs
└── Extensions.cs
├── Azure Tables
├── ORM
│ ├── packages.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Extensions.cs
└── Library
│ ├── packages.config
│ ├── Namespaces.cs
│ ├── TableService.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── StorageCredentials.cs
│ ├── AzureFieldCollection.cs
│ └── Exceptions.cs
├── DreamFactory
├── ORM
│ ├── packages.config
│ └── Properties
│ │ └── AssemblyInfo.cs
├── Library
│ ├── JSON Classes
│ │ ├── CredentialDescriptor.cs
│ │ ├── ResourceDescriptor.cs
│ │ ├── TableDescriptor.cs
│ │ ├── ContainerDescriptor.cs
│ │ ├── ErrorDescriptor.cs
│ │ ├── SessionDescriptor.cs
│ │ ├── ApplicationDescriptor.cs
│ │ ├── FieldDescriptor.cs
│ │ └── SystemConfigDescriptor.cs
│ ├── packages.config
│ ├── Application.cs
│ ├── UriFactory.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Container.cs
└── OpenNETCF.ORM.DreamFactory.Integration.Test
│ ├── TestCreds.cs
│ ├── Entities.cs
│ └── Properties
│ └── AssemblyInfo.cs
├── MySQL
├── MySQLPermissionsException.cs
├── MySQLConnectionInfo.cs
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
└── app.config
├── OpenNETCF.ORM.CF.vssscc
├── OpenNETCF.ORM.FFx.vssscc
├── OpenNETCF.ORM.Android.vssscc
├── OpenNETCF.ORM.FFx.VS11.vssscc
├── OpenNETCF.ORM.FFx.VS12.vssscc
├── OpenNETCF.ORM.WinPhone.vssscc
├── OpenNETCF.ORM.FFx.vsmdi
├── OpenNETCF.ORM.FFx.VS12.vsmdi
├── nuspec
├── opennetcf-orm-core.nuspec
├── opennetcf-orm-sqlcompact.nuspec
├── opennetcf-orm-sqlserver.nuspec
├── opennetcf-orm-mysql.nuspec
└── opennetcf-orm-sqlite.nuspec
├── Local.testsettings
├── OpenNETCF.ORM.FFx.VS11.sln
└── TraceAndTestImpact.testsettings
/.gitignore:
--------------------------------------------------------------------------------
1 | obj/
2 | packages/
3 | /bin
4 | bin/
5 | TestResults/
6 | .vs/
7 |
--------------------------------------------------------------------------------
/Shared/OpenNETCF.ORM.Version.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/Shared/OpenNETCF.ORM.Version.cs
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/northwind.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/Samples/SQLiteNorthwind/northwind.db
--------------------------------------------------------------------------------
/SQLite/targets/linux-arm/SQLite.Interop.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/SQLite/targets/linux-arm/SQLite.Interop.dll
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Test References/OpenNETCF.ORM.SqlCe.accessor:
--------------------------------------------------------------------------------
1 | OpenNETCF.ORM.SqlCe.dll
2 | Desktop
3 |
--------------------------------------------------------------------------------
/SQLite/targets/linux-arm/libSQLite.Interop.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/SQLite/targets/linux-arm/libSQLite.Interop.so
--------------------------------------------------------------------------------
/SQLite/targets/linux-arm64/SQLite.Interop.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/SQLite/targets/linux-arm64/SQLite.Interop.dll
--------------------------------------------------------------------------------
/SQLite/targets/linux-arm/System.Data.SQLite.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/SQLite/targets/linux-arm/System.Data.SQLite.dll
--------------------------------------------------------------------------------
/SQLite/targets/linux-arm64/libSQLite.Interop.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/SQLite/targets/linux-arm64/libSQLite.Interop.so
--------------------------------------------------------------------------------
/SQLite/targets/linux-arm64/System.Data.SQLite.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/SQLite/targets/linux-arm64/System.Data.SQLite.dll
--------------------------------------------------------------------------------
/EntityGenerator/ThirdParty/OpenNETCF/OpenNETCF.IoC.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/EntityGenerator/ThirdParty/OpenNETCF/OpenNETCF.IoC.dll
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/typetest.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/typetest.sdf
--------------------------------------------------------------------------------
/EntityGenerator/ThirdParty/OpenNETCF/OpenNETCF.IoC.UI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/EntityGenerator/ThirdParty/OpenNETCF/OpenNETCF.IoC.UI.dll
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SQLite.Integration.Test/SQLite.Interop.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/Tests/OpenNETCF.ORM.SQLite.Integration.Test/SQLite.Interop.dll
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Resources/Drawable/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctacke/orm/HEAD/Tests/OpenNETCF.ORM.TestHarness.Android/Resources/Drawable/Icon.png
--------------------------------------------------------------------------------
/Core/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Oracle/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/SQL Compact/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/SQL Server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Azure Tables/ORM/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/DreamFactory/ORM/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Azure Tables/Library/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/EntityGenerator/Constants/Delegates.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace EntityGenerator.Constants
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Core/Interfaces/ITableEntity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public interface IEntity
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Samples/ReferenceSample/DataStore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace ReferenceSample
7 | {
8 | class DataStore
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/CredentialDescriptor.cs:
--------------------------------------------------------------------------------
1 | namespace OpenNETCF.DreamFactory
2 | {
3 | internal class CredentialDescriptor
4 | {
5 | public string email { get; set; }
6 | public string password { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/DreamFactory/Library/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Resources/Values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | OpenNETCF.ORM.TestHarness.Android
5 |
6 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SQLite/SQLiteException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace OpenNETCF.ORM
5 | {
6 | public class SQLiteException : Exception
7 | {
8 | public SQLiteException(string message)
9 | : base(message)
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Core/Compatability/DbDataReader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace System.Data.Common
5 | {
6 | #if WINDOWS_PHONE
7 | public interface DbDataReader : IDisposable
8 | {
9 | bool Read();
10 | object this[int ordinal] { get; }
11 | }
12 | #endif
13 | }
14 |
--------------------------------------------------------------------------------
/EntityGenerator/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MySQL/MySQLPermissionsException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace OpenNETCF.ORM
4 | {
5 | public sealed class MySQLPermissionsException : Exception
6 | {
7 | internal MySQLPermissionsException(string message)
8 | : base(message)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Samples/ImageSample/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Core/Replication/ReplicationPriority.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Replication
7 | {
8 | public enum ReplicationPriority
9 | {
10 | Low,
11 | Normal,
12 | High
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Core/SQL Store Base/SqlFilterCondition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class SqlFilterCondition : FilterCondition
9 | {
10 | public bool PrimaryKey { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.CF.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.FFx.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/Core/Replication/ReplicationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Replication
7 | {
8 | public enum ReplicationBehavior
9 | {
10 | ReplicateAndDelete,
11 | ReplicateAndKeep
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.Android.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.FFx.VS11.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.FFx.VS12.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.WinPhone.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/EntityGenerator/EntityGenerator.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/ImageSample/ImageSample.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/SQLiteNorthwind.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/ReferenceSample/ReferenceSample.FFx.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Core/Constants/DefaultType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data;
6 | using System.Reflection;
7 |
8 | namespace OpenNETCF.ORM
9 | {
10 | public enum DefaultType
11 | {
12 | None,
13 | Constant,
14 | CurrentDateTime
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Core/Interfaces/IDefaultValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Reflection;
6 |
7 | namespace OpenNETCF.ORM
8 | {
9 | public interface IDefaultValue
10 | {
11 | DefaultType DefaultType { get; }
12 | object GetDefaultValue();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/OpenNETCF.ORM.Test.CF.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Unit.Test/OpenNETCF.ORM.Unit.Test.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Validation/OpenNETCF.ORM.Validation.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Core/Constants/FieldSearchOrder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data;
6 | using System.Reflection;
7 |
8 | namespace OpenNETCF.ORM
9 | {
10 | public enum FieldSearchOrder
11 | {
12 | NotSearchable = 0,
13 | Ascending = 1,
14 | Descending = 2
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/OpenNETCF.ORM.TestHarness.Android.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/OpenNETCF.ORM.MySQL.Integration.Test.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/OpenNETCF.ORM.SqlCE.Integration.Test.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/OpenNETCF.ORM.Oracle.Integration.Test.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SQLite.Integration.Test/OpenNETCF.ORM.SQLite.Integration.Test.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/OpenNETCF.ORM.SqlServer.Integration.Test.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Core/Entity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class Entity
9 | where T : IEntity
10 | {
11 | private IDataStore m_database;
12 |
13 | public Entity(IDataStore database)
14 | {
15 | m_database = database;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/EntityGenerator/Constants/WizardStep.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace EntityGenerator.Constants
7 | {
8 | enum WizardStep
9 | {
10 | None,
11 | SelectStore,
12 | SelectEntities,
13 | EditEntities,
14 | GenerateCode,
15 | BrowseOutput
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Core/Interfaces/ITableBasedStore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public interface ITableBasedStore : IDataStore
9 | {
10 | string[] GetTableNames();
11 | bool TableExists(string tableName);
12 | void TruncateTable(string tableName);
13 | void DropTable(string tableName);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Reflection;
6 | using OpenNETCF.ORM.Test.Entities;
7 |
8 | namespace OpenNETCF.ORM.Test
9 | {
10 | class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | var test = new SqlCeTest();
15 | test.RunTests();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Core/Phone Compatibility/DbParameter.cs:
--------------------------------------------------------------------------------
1 | #if WINDOWS_PHONE
2 |
3 | namespace System.Data.Common
4 | {
5 |
6 | public interface DbParameterCollection
7 | {
8 | int Count { get; }
9 |
10 | DbParameter this[int index] { get; set; }
11 |
12 | int Add(object value);
13 | void AddRange(Array values);
14 | }
15 |
16 | public interface DbParameter
17 | {
18 | object Value { get; set; }
19 | }
20 | }
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/EntityGenerator/Views/IWizardView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using OpenNETCF.IoC.UI;
6 |
7 | namespace EntityGenerator.Views
8 | {
9 | public interface IWizardView : ISmartPart
10 | {
11 | void OnNavigatingToForward();
12 | void OnNavigatingAwayForward();
13 | void OnNavigatingToBackward();
14 | void OnNavigatingAwayBackward();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Oracle/ODAC/x86/readme.txt:
--------------------------------------------------------------------------------
1 | OpenNETCF.Orm.Oracle requires the following native Oracle client files:
2 |
3 | oci.dll
4 | orannzsbb11.dll
5 | oraocci11.dll
6 | oraociei11.dll
7 | OraOps11w.dll
8 |
9 |
10 | The build system expects these to be present in the source directory at
11 |
12 | $(ProjectDir)\ODAC\x86 or it will not build. Normally I would put these into source control, but one of them is 130MB. I leave it to you to download and extract the appropriate files from Oracle.
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Validation/SQLCEValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | class SQLCEValidator : DataStoreValidator
9 | {
10 | private const string StorePath = "\\SQLCETestStore.sdf";
11 |
12 | protected override IDataStore CreateStoreFile()
13 | {
14 | return new SqlCeDataStore(StorePath);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Validation/SQLiteValidator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using OpenNETCF.ORM;
6 |
7 | namespace OpenNETCF.ORM
8 | {
9 | class SQLiteValidator : DataStoreValidator
10 | {
11 | private const string StorePath = "\\SQLiteTestStore.sdf";
12 |
13 | protected override IDataStore CreateStoreFile()
14 | {
15 | return new SQLiteDataStore(StorePath);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.FFx.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Resources/Layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.FFx.VS12.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DreamFactory/OpenNETCF.ORM.DreamFactory.Integration.Test/TestCreds.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.DreamFactory.Integration.Test
7 | {
8 | internal static class TestCreds
9 | {
10 | public const string UID = "ctacke@opennetcf.com";
11 | public const string PWD = "S&^3Epnn9j";
12 |
13 | // public const string UID = "[your username here]";
14 | // public const string PWD = "[your password here]";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Samples/ReferenceSample/Entities/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using OpenNETCF.ORM;
6 |
7 | namespace ReferenceSample.Entities
8 | {
9 | [Entity(KeyScheme.Identity)]
10 | public class Person
11 | {
12 | [Field(IsPrimaryKey=true)]
13 | public int PersonID { get; set; }
14 | [Field]
15 | public string FirstName { get; set; }
16 | [Field]
17 | public string LastName { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Core/Phone Compatibility/DbConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Documents;
6 | using System.Windows.Ink;
7 | using System.Windows.Input;
8 | using System.Windows.Media;
9 | using System.Windows.Media.Animation;
10 | using System.Windows.Shapes;
11 |
12 | namespace System.Data.Common
13 | {
14 | #if WINDOWS_PHONE
15 | public interface DbConnection : IDisposable
16 | {
17 | void Open();
18 | void Close();
19 | }
20 | #endif
21 | }
22 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/ResourceDescriptor.cs:
--------------------------------------------------------------------------------
1 | using RestSharp.Serializers;
2 | using System.Collections.Generic;
3 |
4 | namespace OpenNETCF.DreamFactory
5 | {
6 | [SerializeAs(Name = "resource")]
7 | internal class ResourceDescriptor
8 | {
9 | public string name { get; set; }
10 | public string label { get; set; }
11 | public string plural { get; set; }
12 | }
13 |
14 | internal class ResourceDescriptorList
15 | {
16 | public List resource { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Core/Phone Compatibility/DbDataReader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Documents;
6 | using System.Windows.Ink;
7 | using System.Windows.Input;
8 | using System.Windows.Media;
9 | using System.Windows.Media.Animation;
10 | using System.Windows.Shapes;
11 |
12 | namespace System.Data.Common
13 | {
14 | #if WINDOWS_PHONE
15 | public interface DbDataReader : IDisposable
16 | {
17 | bool Read();
18 | object this[int ordinal] { get; }
19 | }
20 | #endif
21 | }
22 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/TableDescriptor.cs:
--------------------------------------------------------------------------------
1 | using RestSharp.Serializers;
2 | using System.Collections.Generic;
3 |
4 | namespace OpenNETCF.DreamFactory
5 | {
6 | [SerializeAs(Name = "table")]
7 | internal class TableDescriptor
8 | {
9 | public string name { get; set; }
10 | public string label { get; set; }
11 | public string plural { get; set; }
12 | public string primary_key { get; set; }
13 | public string name_field { get; set; }
14 |
15 | public List field { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/EntityGenerator/Views/EditEntitiesView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using OpenNETCF.IoC.UI;
10 |
11 | namespace EntityGenerator.Views
12 | {
13 | public partial class EditEntitiesView : WizardViewBase
14 | {
15 | public EditEntitiesView()
16 | {
17 | InitializeComponent();
18 | this.Caption = "Edit Entities";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Core/KeyScheme.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public enum KeyScheme
9 | {
10 | ///
11 | /// Entity has no primary key (not recommended)
12 | ///
13 | None,
14 | ///
15 | /// Entity has an auto-incrementing Primary Key
16 | ///
17 | Identity,
18 | ///
19 | /// Entity has a string GUID Primary Key
20 | ///
21 | GUID
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/EntityGenerator/Constants/EventNames.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace EntityGenerator.Constants
7 | {
8 | public static class EventNames
9 | {
10 | public const string BeforeNavigatingForward = "evt:BeforeNavigatingForward";
11 | public const string AfterNavigatingForward = "evt:AfterNavigatingForward";
12 | public const string BeforeNavigatingBack = "evt:BeforeNavigatingBack";
13 | public const string AfterNavigatingBack = "evt:AfterNavigatingBack";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/Entities/SeekItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.SqlCE.Integration.Test
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | class SeekItem
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int ID { get; set; }
13 |
14 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
15 | public int SeekField { get; set; }
16 |
17 | [Field]
18 | public string Data { get; set; }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/Entities/SeekItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.SqlCE.Integration.Test
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | class SeekItem
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int ID { get; set; }
13 |
14 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
15 | public int SeekField { get; set; }
16 |
17 | [Field]
18 | public string Data { get; set; }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Entities/SeekItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.SqlCE.Integration.Test
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | class SeekItem
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int ID { get; set; }
13 |
14 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
15 | public int SeekField { get; set; }
16 |
17 | [Field]
18 | public string Data { get; set; }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/SeekItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.SqlCE.Integration.Test
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | class SeekItem
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int ID { get; set; }
13 |
14 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
15 | public int SeekField { get; set; }
16 |
17 | [Field]
18 | public string Data { get; set; }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/ImageSample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace ImageSample
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/Entities/Author.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | public class Author
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int AuthorID { get; set; }
13 |
14 | [Reference(typeof(Book), "AuthorID", Autofill=true)]
15 | public Book[] Books { get; set; }
16 |
17 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
18 | public string Name { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/Entities/Author.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | public class Author
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int AuthorID { get; set; }
13 |
14 | [Reference(typeof(Book), "AuthorID", Autofill=true)]
15 | public Book[] Books { get; set; }
16 |
17 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
18 | public string Name { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Core/Attributes/EntityAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | [AttributeUsage(AttributeTargets.Class)]
9 | public class EntityAttribute : Attribute
10 | {
11 | public EntityAttribute()
12 | : this(KeyScheme.None)
13 | {
14 | }
15 |
16 | public EntityAttribute(KeyScheme keyScheme)
17 | {
18 | KeyScheme = keyScheme;
19 | }
20 |
21 | public string NameInStore { get; set; }
22 | public KeyScheme KeyScheme { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/Entities/Author.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | public class Author
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int AuthorID { get; set; }
13 |
14 | [Reference(typeof(Book), "AuthorID", Autofill=true)]
15 | public Book[] Books { get; set; }
16 |
17 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
18 | public string Name { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SQLite.Integration.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/Author.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | [Entity(KeyScheme.Identity)]
9 | public class Author
10 | {
11 | [Field(IsPrimaryKey = true)]
12 | public int AuthorID { get; set; }
13 |
14 | [Reference(typeof(Book), "AuthorID", Autofill=true)]
15 | public Book[] Books { get; set; }
16 |
17 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
18 | public string Name { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/EntityGenerator/Entities/IDataSource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows.Forms;
6 | using System.Data.SqlServerCe;
7 | using EntityGenerator.Dialogs;
8 | using OpenNETCF.ORM;
9 |
10 | namespace EntityGenerator.Entities
11 | {
12 | public interface IDataSource
13 | {
14 | string SourceName { get; }
15 | object BrowseForSource(BuildOptions options);
16 | object[] GetPreviousSources(IDataSource sourceType);
17 | void ClearPreviousSources();
18 | EntityInfo[] GetEntityDefinitions();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Core/Compatability/DbConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace System.Data.Common
5 | {
6 | #if WINDOWS_PHONE
7 | public interface IDbConnection : IDisposable
8 | {
9 | string ConnectionString { get; set; }
10 | int ConnectionTimeout { get; }
11 | string Database { get; }
12 | ConnectionState State { get; }
13 | IDbTransaction BeginTransaction();
14 | IDbTransaction BeginTransaction(IsolationLevel il);
15 | void ChangeDatabase(string databaseName);
16 | void Close();
17 | IDbCommand CreateCommand();
18 | void Open();
19 | }
20 | #endif
21 | }
22 |
--------------------------------------------------------------------------------
/Core/Interfaces/IEntityInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data;
6 |
7 | namespace OpenNETCF.ORM
8 | {
9 | public delegate object EntityCreatorDelegate(FieldAttributeCollection fields, IDataReader results);
10 |
11 | public interface IEntityInfo
12 | {
13 | Type EntityType { get; }
14 | FieldAttributeCollection Fields { get; }
15 | ReferenceAttributeCollection References { get; }
16 | EntityAttribute EntityAttribute { get; }
17 | string EntityName { get; }
18 |
19 | EntityCreatorDelegate CreateProxy { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/GuidItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace OpenNETCF.ORM.SqlServer.Integration.Test
8 | {
9 | [Entity(KeyScheme = KeyScheme.GUID)]
10 | public class GuidItem
11 | {
12 | public GuidItem()
13 | {
14 | ID = Guid.NewGuid();
15 | }
16 |
17 | [Field(IsPrimaryKey = true)]
18 | public Guid ID { get; set; }
19 |
20 | [Field]
21 | public int? FieldA { get; set; }
22 | [Field]
23 | public int FieldB { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Core/SqlDateTimeDefault.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data;
6 | using System.Reflection;
7 |
8 | namespace OpenNETCF.ORM
9 | {
10 | public class SqlDateTimeDefault : IDefaultValue
11 | {
12 | public DefaultType DefaultType
13 | {
14 | get { return ORM.DefaultType.CurrentDateTime; }
15 | }
16 |
17 | public object GetDefaultValue()
18 | {
19 | return "GETDATE()";
20 | }
21 |
22 | public static SqlDateTimeDefault Value
23 | {
24 | get { return new SqlDateTimeDefault(); }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Core/Phone Compatibility/DbCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Documents;
6 | using System.Windows.Ink;
7 | using System.Windows.Input;
8 | using System.Windows.Media;
9 | using System.Windows.Media.Animation;
10 | using System.Windows.Shapes;
11 |
12 | namespace System.Data.Common
13 | {
14 | #if WINDOWS_PHONE
15 | public interface DbCommand : IDisposable
16 | {
17 | string CommandText { get; set; }
18 | DbConnection Connection { set; }
19 |
20 | int ExecuteNonQuery();
21 | object ExecuteScalar();
22 | DbDataReader ExecuteReader();
23 | }
24 | #endif
25 | }
26 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/Core/Dynamics/FieldValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class FieldValue : ICloneable
9 | {
10 | public FieldValue(string name, object value)
11 | {
12 | Name = name;
13 | Value = value;
14 | }
15 |
16 | public object Clone()
17 | {
18 | return new FieldValue(Name, Value);
19 | }
20 |
21 | public string Name { get; private set; }
22 | public object Value { get; set; }
23 |
24 | public override string ToString()
25 | {
26 | return string.Format("{0}: {1}", Name, Value);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/ContainerDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace OpenNETCF.DreamFactory
4 | {
5 | internal class ContainerDescriptorList
6 | {
7 | public List container { get; set; }
8 | }
9 |
10 | internal class ContainerDescriptor
11 | {
12 | public string name { get; set; }
13 | public string path { get; set; }
14 | public string last_modified { get; set; }
15 |
16 | public List folder { get; set; }
17 | }
18 |
19 | internal class FolderDescriptor
20 | {
21 | public string name { get; set; }
22 | public string path { get; set; }
23 | public string last_modified { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/ITestClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using OpenNETCF.ORM.Test.Entities;
6 |
7 | namespace OpenNETCF.ORM.Test
8 | {
9 | public interface ITestClass
10 | {
11 | void Initialize();
12 | Book[] GetAllBooks();
13 | Book[] GetBooksOfType(BookType type);
14 | Book GetBookById(int bookID);
15 |
16 | Author GetAuthorByName(string name);
17 | Author GetAuthorById(int id);
18 |
19 | Author[] GetAuthors(int count, int offset);
20 |
21 | int GetAuthorCount();
22 | int GetBookCount();
23 |
24 | void Insert(Author author);
25 | void Update(Author author);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/ErrorDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using RestSharp.Serializers;
6 | using RestSharp.Deserializers;
7 |
8 | namespace OpenNETCF.DreamFactory
9 | {
10 | [SerializeAs(Name = "error")]
11 | // [DeserializeAs(Name = "error")]
12 | public class ErrorDescriptor
13 | {
14 | public ErrorDescriptor()
15 | {
16 | }
17 |
18 | public string message { get; set; }
19 | public int code { get; set; }
20 |
21 | // {"error":[{"message":"Decimal scale '2' is out of valid range.","code":400}]}
22 | }
23 |
24 | internal class ErrorDescriptorList
25 | {
26 | public List error { get; set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Azure Tables/Library/Namespaces.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Xml.Linq;
6 |
7 | namespace OpenNETCF.Azure
8 | {
9 | internal static class Namespaces
10 | {
11 | static Namespaces()
12 | {
13 | Atom = XNamespace.Get("http://www.w3.org/2005/Atom");
14 | DataServices = XNamespace.Get("http://schemas.microsoft.com/ado/2007/08/dataservices");
15 | DataServicesMeta = XNamespace.Get("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
16 | }
17 |
18 | public static XNamespace Atom { get; private set; }
19 | public static XNamespace DataServices { get; private set; }
20 | public static XNamespace DataServicesMeta { get; private set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/PublishedTenantBuildingState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace OpenNETCF.ORM.SqlServer.Integration.Test.Entities
8 | {
9 | [Entity(KeyScheme = KeyScheme.GUID)]
10 | public class PublishedTenantBuildingState : PublishedEntityBase
11 | {
12 | public PublishedTenantBuildingState()
13 | {
14 | }
15 |
16 | [Field]
17 | public double OutsideTemperature { get; set; }
18 | [Field]
19 | public double UnoccupiedSetPoint { get; set; }
20 | [Field]
21 | public double UnoccupiedHeatDeadband { get; set; }
22 | [Field]
23 | public double UnoccupiedCoolDeadband { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Samples/ReferenceSample/Entities/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using OpenNETCF.ORM;
6 |
7 | namespace ReferenceSample.Entities
8 | {
9 | [Entity(KeyScheme.Identity)]
10 | public class Book
11 | {
12 | [Field(IsPrimaryKey=true)]
13 | public int BookID { get; set; }
14 |
15 | [Field(DefaultValue="[untitled]")]
16 | public string Title { get; set; }
17 |
18 | [Reference(typeof(Person), "PersonID")]
19 | public Person[] Authors { get; set; }
20 |
21 | [Reference(typeof(Person), "PersonID")]
22 | public Person[] Illustrators { get; set; }
23 |
24 | [Field(DefaultType = DefaultType.CurrentDateTime)]
25 | public DateTime CreateDate { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Core/FilterCondition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class FilterCondition
9 | {
10 | public FilterCondition()
11 | {
12 | }
13 |
14 | public FilterCondition(string fieldName, object value, FilterOperator @operator)
15 | {
16 | FieldName = fieldName;
17 | Value = value;
18 | Operator = @operator;
19 | }
20 |
21 | public string FieldName { get; set; }
22 | public object Value { get; set; }
23 | public FilterOperator Operator { get; set; }
24 |
25 | public enum FilterOperator
26 | {
27 | Equals,
28 | Like,
29 | LessThan,
30 | GreaterThan
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Core/Compatability/DbParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace System.Data.Common
5 | {
6 | #if WINDOWS_PHONE
7 | public interface IDataParameter
8 | {
9 | DbType DbType { get; set; }
10 | ParameterDirection Direction { get; set; }
11 | bool IsNullable { get; }
12 | string ParameterName { get; set; }
13 | string SourceColumn { get; set; }
14 | DataRowVersion SourceVersion { get; set; }
15 | object Value { get; set; }
16 | }
17 |
18 | public enum ParameterDirection
19 | {
20 | Input = 1,
21 | Output = 2,
22 | InputOutput = 3,
23 | ReturnValue = 6,
24 | }
25 |
26 | public enum DataRowVersion
27 | {
28 | Original = 256,
29 | Current = 512,
30 | Proposed = 1024,
31 | Default = 1536,
32 | }
33 | #endif
34 | }
35 |
--------------------------------------------------------------------------------
/Core/SQL Store Base/ConnectionBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public enum ConnectionBehavior
9 | {
10 | ///
11 | /// Creates a new connection for every access to the database
12 | ///
13 | AlwaysNew,
14 | ///
15 | /// The store keeps a separate connection to the database open for life. This connection is only used for maintenenace-type calls. All data access calls are still done with a new connection every time.
16 | ///
17 | HoldMaintenance,
18 | ///
19 | /// The store holds a single connection for life. It uses that one connection for all database access.
20 | ///
21 | Persistent
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Core/Compatability/IDataParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace System.Data.Common
5 | {
6 | #if WINDOWS_PHONE || ANDROID
7 | public interface IDataParameter
8 | {
9 | DbType DbType { get; set; }
10 | ParameterDirection Direction { get; set; }
11 | bool IsNullable { get; }
12 | string ParameterName { get; set; }
13 | string SourceColumn { get; set; }
14 | DataRowVersion SourceVersion { get; set; }
15 | object Value { get; set; }
16 | }
17 |
18 | public enum ParameterDirection
19 | {
20 | Input = 1,
21 | Output = 2,
22 | InputOutput = 3,
23 | ReturnValue = 6,
24 | }
25 |
26 | public enum DataRowVersion
27 | {
28 | Original = 256,
29 | Current = 512,
30 | Proposed = 1024,
31 | Default = 1536,
32 | }
33 | #endif
34 | }
35 |
--------------------------------------------------------------------------------
/MySQL/MySQLConnectionInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class MySQLConnectionInfo
9 | {
10 | public MySQLConnectionInfo(string serverAddress, int serverPort, string databaseName, string userName, string password)
11 | {
12 | ServerAddress = serverAddress;
13 | ServerPort = serverPort;
14 | DatabaseName = databaseName;
15 | UserName = userName;
16 | Password = password;
17 | }
18 |
19 | public string ServerAddress { get; private set; }
20 | public int ServerPort { get; private set; }
21 | public string DatabaseName { get; private set; }
22 | public string UserName { get; private set; }
23 | public string Password { get; private set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Oracle/OracleConnectionInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class OracleConnectionInfo
9 | {
10 | public OracleConnectionInfo(string serverAddress, int serverPort, string serviceName, string userName, string password)
11 | {
12 | ServerAddress = serverAddress;
13 | ServerPort = serverPort;
14 | ServiceName = serviceName;
15 | UserName = userName;
16 | Password = password;
17 | }
18 |
19 | public string ServerAddress { get; private set; }
20 | public int ServerPort { get; private set; }
21 | public string ServiceName { get; private set; }
22 | public string UserName { get; private set; }
23 | public string Password { get; private set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Core/Compatability/DbType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace System.Data
5 | {
6 | #if WINDOWS_PHONE
7 | public enum DbType
8 | {
9 | AnsiString = 0,
10 | Binary = 1,
11 | Byte = 2,
12 | Boolean = 3,
13 | Currency = 4,
14 | Date = 5,
15 | DateTime = 6,
16 | Decimal = 7,
17 | Double = 8,
18 | Guid = 9,
19 | Int16 = 10,
20 | Int32 = 11,
21 | Int64 = 12,
22 | Object = 13,
23 | SByte = 14,
24 | Single = 15,
25 | String = 16,
26 | Time = 17,
27 | UInt16 = 18,
28 | UInt32 = 19,
29 | UInt64 = 20,
30 | VarNumeric = 21,
31 | AnsiStringFixedLength = 22,
32 | StringFixedLength = 23,
33 | Xml = 25,
34 | DateTime2 = 26,
35 | DateTimeOffset = 27,
36 | }
37 | #endif
38 | }
39 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/SessionDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace OpenNETCF.DreamFactory
4 | {
5 | internal class SessionDescriptor
6 | {
7 | public SessionDescriptor()
8 | {
9 | }
10 |
11 | public string id { get; set; }
12 | public string email { get; set; }
13 | public string first_name { get; set; }
14 | public string last_name { get; set; }
15 | public string display_name { get; set; }
16 | public bool is_sys_admin { get; set; }
17 | public string last_login_date { get; set; }
18 | public string ticket { get; set; }
19 | public long ticket_expiry { get; set; }
20 | public string session_id { get; set; }
21 | public List app_groups { get; set; }
22 | public List no_group_apps { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Core/Compatability/DbCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace System.Data.Common
5 | {
6 | #if WINDOWS_PHONE
7 | public interface IDbCommand : IDisposable
8 | {
9 | Mono.Data.Sqlite.SqliteConnection
10 | string CommandText { get; set; }
11 | int CommandTimeout { get; set; }
12 | CommandType CommandType { get; set; }
13 | IDbConnection Connection { get; set; }
14 | IDataParameterCollection Parameters { get; }
15 | IDbTransaction Transaction { get; set; }
16 | UpdateRowSource UpdatedRowSource { get; set; }
17 | void Cancel();
18 | IDbDataParameter CreateParameter();
19 | int ExecuteNonQuery();
20 | IDataReader ExecuteReader();
21 | IDataReader ExecuteReader(CommandBehavior behavior);
22 | object ExecuteScalar();
23 | void Prepare();
24 | }
25 |
26 | #endif
27 | }
28 |
--------------------------------------------------------------------------------
/MySQL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EntityGenerator/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Windows.Forms;
5 | using OpenNETCF.IoC.UI;
6 | using OpenNETCF.IoC;
7 | using EntityGenerator.Presenters;
8 | using EntityGenerator.Services;
9 |
10 | namespace EntityGenerator
11 | {
12 | public class Program : SmartClientApplication
13 | {
14 | ///
15 | /// The main entry point for the application.
16 | ///
17 | [STAThread]
18 | static void Main()
19 | {
20 | new Program().Start();
21 | }
22 |
23 | public override void AddServices()
24 | {
25 | RootWorkItem.Services.AddNew();
26 | RootWorkItem.Services.AddNew();
27 | RootWorkItem.Services.AddNew();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Core/SQL Store Base/SqlEntityInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class SqlEntityInfo : EntityInfo
9 | {
10 | private int m_pkOrdinal = -1;
11 |
12 | public SqlEntityInfo()
13 | {
14 | PrimaryKeyIndexName = null;
15 | }
16 |
17 | public string PrimaryKeyIndexName { get; set; }
18 | public string PrimaryKeyColumnName { get; set; }
19 | public List IndexNames { get; set; }
20 |
21 | public int PrimaryKeyOrdinal
22 | {
23 | get
24 | {
25 | if (m_pkOrdinal < 0)
26 | {
27 | m_pkOrdinal = this.Fields.First(f => f.IsPrimaryKey).Ordinal;
28 | }
29 | return m_pkOrdinal;
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/ApplicationDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace OpenNETCF.DreamFactory
4 | {
5 | internal class ApplicationDescriptorList
6 | {
7 | public List record { get; set; }
8 | }
9 |
10 | internal class ApplicationDescriptor
11 | {
12 | public ApplicationDescriptor()
13 | {
14 | }
15 |
16 | public string id { get; set; }
17 | public string api_name { get; set; }
18 | public string name { get; set; }
19 | public string description { get; set; }
20 | public string url { get; set; }
21 | public bool? is_url_external { get; set; }
22 | public bool? requires_fullscreen { get; set; }
23 | public bool? allow_fullscreen_toggle { get; set; }
24 | public string toggle_location { get; set; }
25 | public bool? is_default { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Core/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("52b9b42b-5cf8-4b22-8388-a5af5b96478c")]
21 |
--------------------------------------------------------------------------------
/MySQL/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.MySQL")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("e1dea449-8483-435b-9c0b-949b1044aeff")]
21 |
--------------------------------------------------------------------------------
/EntityGenerator/Views/WizardViewBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using OpenNETCF.IoC.UI;
10 |
11 | namespace EntityGenerator.Views
12 | {
13 | public partial class WizardViewBase : SmartPart, IWizardView
14 | {
15 | public WizardViewBase()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | public string Caption
21 | {
22 | get { return caption.Text; }
23 | set { caption.Text = value; }
24 | }
25 |
26 | public virtual void OnNavigatingToForward() { }
27 | public virtual void OnNavigatingAwayForward() { }
28 | public virtual void OnNavigatingToBackward() { }
29 | public virtual void OnNavigatingAwayBackward() { }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Oracle/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.Oracle")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("5eb89b9f-f864-47e0-80f1-a3e47999e951")]
21 |
22 |
--------------------------------------------------------------------------------
/SQL Compact/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.SqlCe")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("52b9b42b-5cf8-4b22-8388-a5af5b96478c")]
21 |
--------------------------------------------------------------------------------
/Azure Tables/ORM/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.Azure")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("70fdca10-122c-4b24-98a4-809eec93e870")]
21 |
--------------------------------------------------------------------------------
/SQL Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.SqlServer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("d39c0f35-5eaa-4264-b05a-3101f762c00c")]
21 |
22 |
--------------------------------------------------------------------------------
/DreamFactory/ORM/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.DreamFactory")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | // Setting ComVisible to false makes the types in this assembly not visible
15 | // to COM components. If you need to access a type in this assembly from
16 | // COM, set the ComVisible attribute to true on that type.
17 | [assembly: ComVisible(false)]
18 |
19 | // The following GUID is for the ID of the typelib if this project is exposed to COM
20 | [assembly: Guid("3b397700-773b-4cda-9aba-291b21f4a0d5")]
21 |
--------------------------------------------------------------------------------
/EntityGenerator/Entities/EntityInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows.Forms;
6 | using System.Data.SqlServerCe;
7 | using EntityGenerator.Dialogs;
8 | using OpenNETCF.ORM;
9 |
10 | namespace EntityGenerator.Entities
11 | {
12 | public class ReferenceInfo
13 | {
14 | public string ReferenceTable { get; set; }
15 | public string LocalFieldName { get; set; }
16 | public string RemoteFieldName { get; set; }
17 | }
18 |
19 | public class EntityInfo
20 | {
21 | public EntityInfo()
22 | {
23 | Fields = new List();
24 | References = new List();
25 | }
26 |
27 | public EntityAttribute Entity { get; set; }
28 | public List Fields { get; set; }
29 | public List References { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/nuspec/opennetcf-orm-core.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | opennetcf-orm-core
5 | 1.0.19171.0
6 | OpenNETCF ORM Core
7 | Chris Tacke
8 | false
9 | The core bits OpenNETCF's ORM Framework with no storage implementation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/nuspec/opennetcf-orm-sqlcompact.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | opennetcf-orm-sqlcompact
5 | 1.0.17254.0
6 | OpenNETCF ORM for Microsoft SQL Server Compact
7 | Chris Tacke
8 | false
9 | OpenNETCF's ORM Framework with the Microsoft SQL Server Compact Implementation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Core/Phone Compatibility/DbType.cs:
--------------------------------------------------------------------------------
1 |
2 | #if WINDOWS_PHONE
3 |
4 | namespace System.Data
5 | {
6 | public enum CommandType
7 | {
8 | Text = 1,
9 | StoredProcedure = 4,
10 | TableDirect = 512,
11 | }
12 |
13 | public enum DbType
14 | {
15 | AnsiString = 0,
16 | Binary = 1,
17 | Byte = 2,
18 | Boolean = 3,
19 | Currency = 4,
20 | Date = 5,
21 | DateTime = 6,
22 | Decimal = 7,
23 | Double = 8,
24 | Guid = 9,
25 | Int16 = 10,
26 | Int32 = 11,
27 | Int64 = 12,
28 | Object = 13,
29 | SByte = 14,
30 | Single = 15,
31 | String = 16,
32 | Time = 17,
33 | UInt16 = 18,
34 | UInt32 = 19,
35 | UInt64 = 20,
36 | VarNumeric = 21,
37 | AnsiStringFixedLength = 22,
38 | StringFixedLength = 23,
39 | Xml = 25,
40 | DateTime2 = 26,
41 | DateTimeOffset = 27,
42 | }
43 | }
44 | #endif
45 |
--------------------------------------------------------------------------------
/Core/Interfaces/ISQLBasedStore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace OpenNETCF.ORM
8 | {
9 | public interface ISQLBasedStore : IDataStore
10 | {
11 | ConnectionBehavior ConnectionBehavior { get; set; }
12 |
13 | string[] GetTableNames();
14 |
15 | int ExecuteNonQuery(string sql, bool throwExceptions);
16 | int ExecuteNonQuery(string sql);
17 | object ExecuteScalar(string sql);
18 | IDataReader ExecuteReader(string sql);
19 | IDataReader ExecuteReader(string sql, bool throwExceptions);
20 | IDataReader ExecuteReader(string sql, IEnumerable parameters);
21 | IDataReader ExecuteReader(string sql, IEnumerable parameters, bool throwExceptions);
22 | IDataReader ExecuteReader(string sql, IEnumerable parameters, CommandBehavior behavior, bool throwExceptions);
23 | void CloseReader();
24 |
25 | void CompactDatabase();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/FieldDescriptor.cs:
--------------------------------------------------------------------------------
1 | using RestSharp.Serializers;
2 |
3 | namespace OpenNETCF.DreamFactory
4 | {
5 | [SerializeAs(Name = "field")]
6 | internal class FieldDescriptor
7 | {
8 | public string name { get; set; }
9 | public string label { get; set; }
10 | public string type { get; set; }
11 | public string db_type { get; set; }
12 |
13 | public int? length { get; set; }
14 | public int? precision { get; set; }
15 | public int? scale { get; set; }
16 |
17 | public bool? required { get; set; }
18 | public bool? allow_null { get; set; }
19 | public bool? fixed_length { get; set; }
20 | public bool? supports_multibyte { get; set; }
21 | public bool? auto_increment { get; set; }
22 | public bool? is_primary_key { get; set; }
23 | public bool? is_foreign_key { get; set; }
24 |
25 | public string ref_table { get; set; }
26 | public string ref_fields { get; set; }
27 | public string validation { get; set; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/nuspec/opennetcf-orm-sqlserver.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | opennetcf-orm-sqlserver
5 | 1.0.19094.0
6 | OpenNETCF ORM for Microsoft SQL Server
7 | Chris Tacke
8 | false
9 | OpenNETCF's ORM Framework with the Microsoft SQL Server Implementation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/nuspec/opennetcf-orm-mysql.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | opennetcf-orm-mysql
5 | 1.0.19122.0
6 | OpenNETCF ORM for MySQL
7 | Chris Tacke
8 | false
9 | OpenNETCF's ORM Framework with the MySQL Implementation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SQLite/targets/readme.md:
--------------------------------------------------------------------------------
1 | # building the SQLIT Interop assemblies and libraries
2 |
3 | on the desired target (i.e. on an ARM64 linux device if you want a linux-arm64 binary):
4 |
5 | - Create a folder for the source
6 | - copy contents of the source zip to that folder
7 | - zip available at: https://system.data.sqlite.org/downloads/1.0.118.0/sqlite-netFx-source-1.0.118.0.zip
8 | - edit `Setup/compile-interop-assembly-release.sh` to include `gccflags` for the target architecture
9 | - e.g. modify line 10 to be `gccflags="-arch x86_64 -arch arm64"`
10 |
11 | ```
12 | $ cd Setup
13 | $ chmod +x compile-interop-assembly-release.sh
14 | $./compile-interop-assembly-release.sh`
15 | ```
16 |
17 | The `libSQLite.Interop.so` and `SQLite.Interop.dll` will now be in `./bin/2013/Release/bin`
18 |
19 | ```
20 | $ curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel STS
21 | $ cd ../System.Data.SQLite.Module.2013.csproj
22 | $ dotnet build -c Release System.Data.SQLite.NetStandard21.csproj
23 | ```
24 |
25 | The `System.Data.SQLite.dll` assembly will be at `src/bin/NetStandard21/ReleaseNetStandard21/bin/netstandard2.1/System.Data.SQLite.dll`
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SQLite.Integration.Test/OpenNETCF.ORM.SQLite.Core.Integration.Test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/SQL Server/SqlConnectionInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class SqlConnectionInfo : ICloneable
9 | {
10 | public SqlConnectionInfo()
11 | {
12 | }
13 |
14 | public string ServerName { get; set; }
15 | public int ServerPort { get; set; }
16 | public string InstanceName { get; set; }
17 | public string DatabaseName { get; set; }
18 | public string UserDomain { get; set; }
19 | public string UserName { get; set; }
20 | public string Password { get; set; }
21 |
22 | public object Clone()
23 | {
24 | return new SqlConnectionInfo()
25 | {
26 | ServerName = this.ServerName,
27 | ServerPort = this.ServerPort,
28 | DatabaseName = this.DatabaseName,
29 | InstanceName = this.InstanceName,
30 | UserDomain = this.UserDomain,
31 | UserName = this.UserName,
32 | Password = this.Password
33 | };
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/Entities/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum BookType
9 | {
10 | Fiction,
11 | NonFiction
12 | }
13 |
14 | [Entity(KeyScheme.Identity)]
15 | public class Book
16 | {
17 | public Book()
18 | {
19 | // this is required for cascading inserts to work
20 | BookID = -1;
21 | }
22 |
23 | [Field(IsPrimaryKey=true)]
24 | public int BookID { get; set; }
25 |
26 | [Field]
27 | public int AuthorID { get; set; }
28 |
29 | [Reference(typeof(Author), "AuthorID", ReferenceType = ReferenceType.ManyToOne)]
30 | public Author Author { get; set; }
31 |
32 | [Field]
33 | public string Title { get; set; }
34 |
35 |
36 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
37 | public BookType BookType { get; set; }
38 |
39 | [Field(IsRowVersion=true)]
40 | public long RowVersion { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/Entities/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum BookType
9 | {
10 | Fiction,
11 | NonFiction
12 | }
13 |
14 | [Entity(KeyScheme.Identity)]
15 | public class Book
16 | {
17 | public Book()
18 | {
19 | // this is required for cascading inserts to work
20 | BookID = -1;
21 | }
22 |
23 | [Field(IsPrimaryKey=true)]
24 | public int BookID { get; set; }
25 |
26 | [Field]
27 | public int AuthorID { get; set; }
28 |
29 | [Reference(typeof(Author), "AuthorID", ReferenceType = ReferenceType.ManyToOne)]
30 | public Author Author { get; set; }
31 |
32 | [Field]
33 | public string Title { get; set; }
34 |
35 |
36 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
37 | public BookType BookType { get; set; }
38 |
39 | [Field(IsRowVersion=true)]
40 | public long RowVersion { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/Entities/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum BookType
9 | {
10 | Fiction,
11 | NonFiction
12 | }
13 |
14 | [Entity(KeyScheme.Identity)]
15 | public class Book
16 | {
17 | public Book()
18 | {
19 | // this is required for cascading inserts to work
20 | BookID = -1;
21 | }
22 |
23 | [Field(IsPrimaryKey=true)]
24 | public int BookID { get; set; }
25 |
26 | [Field]
27 | public int AuthorID { get; set; }
28 |
29 | [Reference(typeof(Author), "AuthorID", ReferenceType = ReferenceType.ManyToOne)]
30 | public Author Author { get; set; }
31 |
32 | [Field]
33 | public string Title { get; set; }
34 |
35 |
36 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
37 | public BookType BookType { get; set; }
38 |
39 | [Field(IsRowVersion=true)]
40 | public long RowVersion { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Entities/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum BookType
9 | {
10 | Fiction,
11 | NonFiction
12 | }
13 |
14 | [Entity(KeyScheme.Identity)]
15 | public class Book
16 | {
17 | public Book()
18 | {
19 | // this is required for cascading inserts to work
20 | BookID = -1;
21 | }
22 |
23 | [Field(IsPrimaryKey=true)]
24 | public int BookID { get; set; }
25 |
26 | [Field]
27 | public int AuthorID { get; set; }
28 |
29 | [Reference(typeof(Author), "AuthorID", ReferenceType = ReferenceType.ManyToOne)]
30 | public Author Author { get; set; }
31 |
32 | [Field]
33 | public string Title { get; set; }
34 |
35 |
36 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
37 | public BookType BookType { get; set; }
38 |
39 | [Field(IsRowVersion=true)]
40 | public long RowVersion { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum BookType
9 | {
10 | Fiction,
11 | NonFiction
12 | }
13 |
14 | [Entity(KeyScheme.Identity)]
15 | public class Book
16 | {
17 | public Book()
18 | {
19 | // this is required for cascading inserts to work
20 | BookID = -1;
21 | }
22 |
23 | [Field(IsPrimaryKey=true)]
24 | public int BookID { get; set; }
25 |
26 | [Field]
27 | public int AuthorID { get; set; }
28 |
29 | [Reference(typeof(Author), "AuthorID", ReferenceType = ReferenceType.ManyToOne)]
30 | public Author Author { get; set; }
31 |
32 | [Field]
33 | public string Title { get; set; }
34 |
35 |
36 | [Field(SearchOrder=FieldSearchOrder.Ascending)]
37 | public BookType BookType { get; set; }
38 |
39 | [Field(IsRowVersion=true)]
40 | public long RowVersion { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/DreamFactory/Library/Application.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using RestSharp;
6 |
7 | namespace OpenNETCF.DreamFactory
8 | {
9 | public sealed class Application
10 | {
11 | public string Name { get; set; }
12 | public string ID { get; private set; }
13 | public string URL { get; private set; }
14 | public string APIName { get; set; }
15 | public string Description { get; set; }
16 |
17 | internal Application(ApplicationDescriptor descriptor)
18 | {
19 | Name = descriptor.name;
20 | ID = descriptor.id;
21 | URL = descriptor.url;
22 | APIName = descriptor.api_name;
23 | Description = descriptor.description;
24 | }
25 |
26 | internal ApplicationDescriptor AsApplicationDescriptor()
27 | {
28 | var descriptor = new ApplicationDescriptor()
29 | {
30 | name = Name,
31 | id = ID,
32 | api_name = APIName,
33 | description = Description
34 | };
35 |
36 | return descriptor;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/nuspec/opennetcf-orm-sqlite.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | opennetcf-orm-sqlite
5 | 1.0.19109.0
6 | OpenNETCF ORM for SQLite
7 | Chris Tacke
8 | false
9 | OpenNETCF's ORM Framework with the SQLite Implementation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/EntityGenerator/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.235
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EntityGenerator.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Samples/ImageSample/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ImageSample.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Samples/ImageSample/DataClass.cs:
--------------------------------------------------------------------------------
1 | using OpenNETCF.ORM;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 |
9 | namespace ImageSample
10 | {
11 | [Entity]
12 | class DataClass
13 | {
14 | [Field]
15 | public string Name { get; set; }
16 | [Field]
17 | public Image Picture { get; set; }
18 |
19 | public byte[] Serialize(string fieldName)
20 | {
21 | if (fieldName == "Picture")
22 | {
23 | using (var ms = new MemoryStream())
24 | {
25 | this.Picture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
26 | return ms.ToArray();
27 | }
28 | }
29 |
30 | return null;
31 | }
32 |
33 | public object Deserialize(string fieldName, byte[] data)
34 | {
35 | if (fieldName == "Picture")
36 | {
37 | using (var ms = new MemoryStream(data))
38 | {
39 | return Image.FromStream(ms);
40 | }
41 | }
42 |
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/DreamFactory/Library/UriFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace OpenNETCF.DreamFactory
4 | {
5 | internal sealed class UriFactory
6 | {
7 | private Version m_version;
8 |
9 | public string SchemaRoot { get; private set; }
10 |
11 | public UriFactory(Version dspVersion)
12 | {
13 | m_version = dspVersion;
14 |
15 | bool legacySchema = false;
16 |
17 | if(m_version.Major <= 1)
18 | {
19 | if(m_version.Minor < 7)
20 | {
21 | legacySchema = true;
22 | }
23 | else if(m_version.Minor == 7)
24 | {
25 | if(m_version.Build < 6)
26 | {
27 | legacySchema = true;
28 | }
29 | }
30 | }
31 |
32 | if (legacySchema)
33 | {
34 | SchemaRoot = "/rest/schema";
35 | }
36 | else
37 | {
38 | SchemaRoot = "/rest/db/_schema";
39 | }
40 | }
41 |
42 | public string GetTableSchema(string tableName)
43 | {
44 | return string.Format("{0}/{1}", SchemaRoot, tableName);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Local.testsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 | These are default test settings for a local test run.
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Core/Replication/ReplicatorCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Replication
7 | {
8 | public sealed class ReplicatorCollection : IEnumerable
9 | {
10 | private List m_replicators;
11 | private IDataStore m_source;
12 |
13 | internal ReplicatorCollection(IDataStore source)
14 | {
15 | m_replicators = new List();
16 | m_source = source;
17 | }
18 |
19 | public void Add(Replicator replicator)
20 | {
21 | lock (m_replicators)
22 | {
23 | replicator.SetSource(m_source);
24 | m_replicators.Add(replicator);
25 | }
26 |
27 | replicator.Start();
28 | }
29 |
30 | public int Count
31 | {
32 | get { return m_replicators.Count; }
33 | }
34 |
35 | public IEnumerator GetEnumerator()
36 | {
37 | lock (m_replicators)
38 | {
39 | return m_replicators.GetEnumerator();
40 | }
41 | }
42 |
43 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
44 | {
45 | return GetEnumerator();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Azure Tables/Library/TableService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Net;
6 | using System.IO;
7 | using System.Xml.Linq;
8 | using System.Globalization;
9 | using System.Security.Cryptography;
10 | using System.Text.RegularExpressions;
11 | using System.Collections.Specialized;
12 | using OpenNETCF.WindowsAzure.StorageClient;
13 |
14 | namespace OpenNETCF.Azure
15 | {
16 | public class TableService
17 | {
18 | private ServiceProxy m_proxy;
19 | private AzureTableCollection m_tables;
20 |
21 | public TableService(string baseAddress, StorageCredentials credentials)
22 | : this(new Uri(baseAddress), credentials)
23 | {
24 | }
25 |
26 | public TableService(Uri baseUri, StorageCredentials credentials)
27 | {
28 | m_proxy = new ServiceProxy(baseUri, credentials);
29 | }
30 |
31 | public AzureTableCollection Tables
32 | {
33 | get
34 | {
35 | // lazy load the first instance
36 | if (m_tables == null)
37 | {
38 | m_tables = new AzureTableCollection(m_proxy);
39 | m_tables.Refresh();
40 | }
41 |
42 | return m_tables;
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("ab14e010-5908-42cc-8521-a5d0cd23fa25")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 |
34 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Validation/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.Validation")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.Validation")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f0534c7c-5d87-4ef2-a15c-53941dc9733c")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 |
34 |
--------------------------------------------------------------------------------
/Azure Tables/ORM/Extensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Security.Cryptography;
6 | using System.Globalization;
7 | using System.Net;
8 | using System.IO;
9 | using System.Xml.Linq;
10 | using OpenNETCF.Azure;
11 |
12 | namespace OpenNETCF.ORM
13 | {
14 | internal static class Extensions
15 | {
16 | public static DynamicEntity AsDynamicEntity(this AzureEntity entity, DynamicEntityDefinition definition)
17 | {
18 | var de = new DynamicEntity(definition.EntityName);
19 | de.Fields.Add("PartitionKey", entity.PartitionKey);
20 | de.Fields.Add("RowKey", entity.RowKey);
21 |
22 | foreach (var f in entity.Fields)
23 | {
24 | if (!definition.Fields.ContainsField(f.Name))
25 | {
26 | continue;
27 | }
28 |
29 | if ((f.Value.ToString() == string.Empty) && (definition.Fields[f.Name].DataType != System.Data.DbType.String))
30 | {
31 | // we store an empty string for non-string 'null' values in the Table Service
32 | de.Fields.Add(f.Name, null);
33 | }
34 | else
35 | {
36 | de.Fields.Add(f.Name, f.Value);
37 | }
38 | }
39 |
40 | return de;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Core/Dynamics/DynamicEntity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class DynamicEntity : ICloneable
9 | {
10 | public string EntityName { get; set; }
11 | public FieldCollection Fields { get; private set; }
12 | public string KeyField { get; set; }
13 |
14 | public DynamicEntity()
15 | : this(null, null)
16 | {
17 | }
18 |
19 | public DynamicEntity(string entityName)
20 | : this(entityName, null)
21 | {
22 | }
23 |
24 | public DynamicEntity(string entityName, FieldAttributeCollection fields)
25 | {
26 | EntityName = entityName;
27 | Fields = new FieldCollection();
28 |
29 | if (fields != null)
30 | {
31 | foreach (var f in fields)
32 | {
33 | this.Fields.Add(f.FieldName);
34 |
35 | if (f.IsPrimaryKey)
36 | {
37 | this.KeyField = f.FieldName;
38 | }
39 | }
40 | }
41 | }
42 |
43 | public object Clone()
44 | {
45 | return new DynamicEntity(EntityName)
46 | {
47 | Fields = this.Fields.Clone() as FieldCollection,
48 | KeyField = this.KeyField
49 | };
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/DreamFactory/OpenNETCF.ORM.DreamFactory.Integration.Test/Entities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.DreamFactory.Integration.Test
7 | {
8 | [Entity(KeyScheme = KeyScheme.Identity)]
9 | public class TestItem : IEquatable
10 | {
11 | public TestItem()
12 | {
13 | RecordDate = DateTime.Now;
14 | }
15 |
16 | public TestItem(string name)
17 | : this()
18 | {
19 | Name = name;
20 | }
21 |
22 | [Field(IsPrimaryKey = true)]
23 | public int ID { get; set; }
24 |
25 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
26 | public string Name { get; set; }
27 |
28 | [Field]
29 | public Guid? UUID { get; set; }
30 |
31 | [Field]
32 | public int ITest { get; set; }
33 |
34 | [Field]
35 | public string Address { get; set; }
36 |
37 | [Field]
38 | public float FTest { get; set; }
39 |
40 | [Field]
41 | public double DBTest { get; set; }
42 |
43 | [Field(Scale = 2)]
44 | public decimal DETest { get; set; }
45 |
46 | [Field]
47 | public TimeSpan TS { get; set; }
48 |
49 | [Field]
50 | public DateTime RecordDate { get; set; }
51 |
52 | public bool Equals(TestItem other)
53 | {
54 | return this.ID == other.ID;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Azure Tables/Library/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.Azure")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("FramTack, LLC")]
12 | [assembly: AssemblyProduct("OpenNETCF.Azure")]
13 | [assembly: AssemblyCopyright("Copyright © FramTack, LLC 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d971f69c-ba98-4fed-ad4b-76ca864b5549")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Core/EntityInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data;
6 |
7 | namespace OpenNETCF.ORM
8 | {
9 | public class EntityInfo : IEntityInfo
10 | {
11 | public EntityInfo()
12 | {
13 | Fields = new FieldAttributeCollection();
14 | References = new ReferenceAttributeCollection();
15 | }
16 |
17 | internal void Initialize(EntityAttribute entityAttribute, Type entityType)
18 | {
19 | EntityAttribute = entityAttribute;
20 | EntityType = entityType;
21 | }
22 |
23 | public Type EntityType { get; protected set; }
24 |
25 | public FieldAttributeCollection Fields { get; private set; }
26 | public ReferenceAttributeCollection References { get; private set; }
27 |
28 | public EntityAttribute EntityAttribute { get; set; }
29 | public EntityCreatorDelegate CreateProxy { get; set; }
30 |
31 | public string EntityName
32 | {
33 | get
34 | {
35 | return EntityAttribute.NameInStore;
36 | }
37 | internal set
38 | {
39 | EntityAttribute.NameInStore = value;
40 | }
41 | }
42 |
43 | public override string ToString()
44 | {
45 | return EntityName;
46 | }
47 |
48 | public void AddField(FieldAttribute field)
49 | {
50 | Fields.Add(field);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/SQLite/OpenNETCF.ORM.SQLite.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7
5 | 1.0.23048
6 | 1.0.23048
7 | MIT-0
8 | https://github.com/ctacke/orm
9 | OpenNETCF's ORM Framework with the SQLite Implementation
10 | 2016-2023
11 | https://github.com/ctacke/orm
12 | ORM; OpenNETCF
13 | opennetcf-orm-sqlite
14 | OpenNETCF ORM Core
15 | 1.0.23048.1
16 |
17 |
18 |
19 | ..\..\bin\Core\Debug\
20 | true
21 |
22 |
23 |
24 | ..\..\bin\Core\Release\
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/DreamFactory/Library/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.DreamFactory")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.DreamFactory")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("a2ef179e-37eb-441e-a28e-9fc89358c9b9")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Unit.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.Unit.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.Unit.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("ac3e1618-8747-4da2-bc91-084ce61e0df3")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Azure Tables/Library/StorageCredentials.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | #if WindowsCE
7 | using OpenNETCF.Security.Cryptography;
8 | #endif
9 |
10 | using System.Security.Cryptography;
11 |
12 | namespace OpenNETCF.WindowsAzure.StorageClient
13 | {
14 | public abstract class StorageCredentials
15 | {
16 | public string AccountName { get; set; }
17 |
18 | public abstract bool CanComputeHmac { get; }
19 | public abstract string ComputeHmac(string value);
20 |
21 | }
22 |
23 | public class StorageCredentialsAccountAndKey : StorageCredentials
24 | {
25 | private byte[] AccountKey { get; set; }
26 |
27 | public StorageCredentialsAccountAndKey(string accountName, string key)
28 | : this(accountName, Convert.FromBase64String(key))
29 | {
30 | }
31 |
32 | public StorageCredentialsAccountAndKey(string accountName, byte[] key)
33 | {
34 | AccountName = accountName;
35 | AccountKey = key;
36 | }
37 |
38 | public override bool CanComputeHmac
39 | {
40 | get { return true; }
41 | }
42 |
43 | public override string ComputeHmac(string value)
44 | {
45 | using (var hmacSha256 = new HMACSHA256(AccountKey))
46 | {
47 | var dataToHash = System.Text.Encoding.UTF8.GetBytes(value);
48 | return Convert.ToBase64String(hmacSha256.ComputeHash(dataToHash));
49 | }
50 | }
51 | }
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/EntityGenerator/Dialogs/GetPasswordDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace EntityGenerator.Dialogs
11 | {
12 | public partial class GetPasswordDialog : Form
13 | {
14 | public string Password { get; private set; }
15 |
16 | public GetPasswordDialog()
17 | {
18 | InitializeComponent();
19 |
20 | password.KeyDown += new KeyEventHandler(password_KeyDown);
21 | }
22 |
23 | void password_KeyDown(object sender, KeyEventArgs e)
24 | {
25 | switch(e.KeyCode)
26 | {
27 | case Keys.Enter:
28 | AcceptPassword();
29 | break;
30 | case Keys.Escape:
31 | CancelPassword();
32 | break;
33 | }
34 | }
35 |
36 | private void ok_Click(object sender, EventArgs e)
37 | {
38 | AcceptPassword();
39 | }
40 |
41 | private void AcceptPassword()
42 | {
43 | Password = password.Text;
44 | this.DialogResult = DialogResult.OK;
45 | this.Close();
46 | }
47 |
48 | private void CancelPassword()
49 | {
50 | Password = string.Empty;
51 | this.DialogResult = DialogResult.Cancel;
52 | this.Close();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/EntityGenerator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EntityGenerator")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EntityGenerator")]
13 | [assembly: AssemblyCopyright("Copyright © 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("989cb50c-e7da-47db-97c2-ee0e0b75caf4")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("0.9.13017.0")]
36 | [assembly: AssemblyFileVersion("0.9.13017.0")]
37 |
--------------------------------------------------------------------------------
/Samples/ReferenceSample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ReferenceSample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ReferenceSample")]
13 | [assembly: AssemblyCopyright("Copyright © 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("4fceafcd-ac8e-450d-94dc-429e029f37de")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Samples/ImageSample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ImageSample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("ImageSample")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("ba724929-6756-4f49-9720-7fa3054e5b31")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DreamFactory/Library/Container.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using RestSharp;
6 |
7 | namespace OpenNETCF.DreamFactory
8 | {
9 | public sealed class Container
10 | {
11 | public string Name { get; private set; }
12 | public string Path { get; private set; }
13 | public DateTime? LastModified { get; private set; }
14 | public Container[] Containers { get; set; }
15 |
16 | internal Container(ContainerDescriptor descriptor)
17 | {
18 | this.Name = descriptor.name;
19 | this.Path = descriptor.path;
20 | try
21 | {
22 | if (!descriptor.last_modified.IsNullOrEmpty())
23 | {
24 | this.LastModified = DateTime.Parse(descriptor.last_modified);
25 | }
26 | }
27 | catch
28 | {
29 | // default to null
30 | }
31 |
32 | if (descriptor.folder != null)
33 | {
34 | Containers = new Container[descriptor.folder.Count];
35 | var i = 0;
36 |
37 | foreach (var c in descriptor.folder)
38 | {
39 | Containers[i] = new Container(c);
40 | i++;
41 | }
42 | }
43 | else
44 | {
45 | Containers = new Container[0];
46 | }
47 | }
48 |
49 | public override string ToString()
50 | {
51 | return Name;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SQLiteNorthwind")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("SQLiteNorthwind")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f522096d-0a3e-44d5-8d2e-91090ef16192")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DreamFactory/OpenNETCF.ORM.DreamFactory.Integration.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.DreamFactory.Integration.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.DreamFactory.Integration.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("e6a6698a-6aff-4774-be80-0edb7cab1d3a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.SqlCE.Integration.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.SqlCE.Integration.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("2d9ff38c-8a55-4640-94db-5b1fc7f975ef")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.MySQL.Integration.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.MySQL.Integration.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("a6cd65d7-0365-4663-9363-b17870032d86")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.Oracle.Integration.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.Oracle.Integration.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("12578d16-ee03-4fec-82bf-0582a2eae7de")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenNETCF.ORM.SqlServer.Integration.Test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("OpenNETCF.ORM.SqlServer.Integration.Test")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("86464792-7a13-4d35-aa05-015e68071ee1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Resources/Resource.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.239
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace OpenNETCF.ORM.TestHarness.Android
12 | {
13 |
14 |
15 | public partial class Resource
16 | {
17 |
18 | public partial class Attribute
19 | {
20 |
21 | private Attribute()
22 | {
23 | }
24 | }
25 |
26 | public partial class Drawable
27 | {
28 |
29 | // aapt resource value: 0x7f020000
30 | public const int Icon = 2130837504;
31 |
32 | private Drawable()
33 | {
34 | }
35 | }
36 |
37 | public partial class Id
38 | {
39 |
40 | // aapt resource value: 0x7f050000
41 | public const int MyButton = 2131034112;
42 |
43 | private Id()
44 | {
45 | }
46 | }
47 |
48 | public partial class Layout
49 | {
50 |
51 | // aapt resource value: 0x7f030000
52 | public const int Main = 2130903040;
53 |
54 | private Layout()
55 | {
56 | }
57 | }
58 |
59 | public partial class String
60 | {
61 |
62 | // aapt resource value: 0x7f040001
63 | public const int ApplicationName = 2130968577;
64 |
65 | // aapt resource value: 0x7f040000
66 | public const int Hello = 2130968576;
67 |
68 | private String()
69 | {
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/PublishedTenantApartmentState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace OpenNETCF.ORM.SqlServer.Integration.Test.Entities
8 | {
9 | public enum HVACControlState
10 | {
11 | Heating,
12 | Cooling
13 | }
14 |
15 | [Entity(KeyScheme = KeyScheme.GUID)]
16 | public class PublishedTenantApartmentState : PublishedEntityBase
17 | {
18 | public PublishedTenantApartmentState()
19 | {
20 | }
21 |
22 | ///
23 | /// Foreign-key to the PublishedTenenantBuildingState
24 | ///
25 | [Field]
26 | public Guid PublishedBuildingStateID { get; set; }
27 |
28 | [Field]
29 | public string ApartmentName { get; set; }
30 |
31 | ///
32 | /// Last time the apartment thermostat was contacted
33 | ///
34 | [Field]
35 | public DateTime LastContact { get; set; }
36 |
37 | [Field]
38 | public HVACControlState ControlState { get; set; }
39 |
40 | [Field]
41 | public bool Occupied { get; set; }
42 |
43 | [Field]
44 | public double SpaceTemperature { get; set; }
45 |
46 | [Field]
47 | public double? SupplyTemperature { get; set; }
48 |
49 | [Field]
50 | public double? ReturnTemperature { get; set; }
51 |
52 | [Field]
53 | public double SetPoint { get; set; }
54 |
55 | [Field]
56 | public double HeatDeadband { get; set; }
57 |
58 | [Field]
59 | public double CoolDeadband { get; set; }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using OpenNETCF.ORM;
6 | using System.Windows.Forms;
7 | using System.IO;
8 | using System.Reflection;
9 |
10 | namespace SQLiteNorthwind
11 | {
12 | class Program
13 | {
14 | static void Main(string[] args)
15 | {
16 | new Program().Run();
17 | }
18 |
19 | public void Run()
20 | {
21 | var store = new SQLiteDataStore(Path.Combine( Application.StartupPath, "northwind.db"));
22 |
23 | // get all orders, with the associated (reference) customer for each
24 | var orders = store.Select(true).ToArray();
25 |
26 | var oldOrder = orders.Last();
27 |
28 | // create a new order for the same customer as the last in the list
29 | var newOrder = new Orders()
30 | {
31 | OrderID = oldOrder.OrderID + 1, // this database does not use auto-incrementing keys
32 | CustomerID = oldOrder.CustomerID,
33 | ShipName = "ATTN: John Steinbeck",
34 | ShipAddress = "7 Rue de M",
35 | ShipCity = "Paris",
36 | ShipCountry = "France",
37 | ShippedDate = new DateTime(1955, 6, 1)
38 | };
39 |
40 | // insert that order
41 | store.Insert(newOrder);
42 |
43 | // select that order back out by PK
44 | var order = store.Select(o => o.ShipName.Contains("Steinbeck")).First();
45 |
46 | // now delete that order by PK value
47 | store.Delete(order.OrderID);
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/DreamFactory/Library/JSON Classes/SystemConfigDescriptor.cs:
--------------------------------------------------------------------------------
1 | using RestSharp.Serializers;
2 | using System;
3 |
4 | namespace OpenNETCF.DreamFactory
5 | {
6 | [SerializeAs(Name = "config")]
7 | internal class SystemConfigDescriptor
8 | {
9 | public bool allow_admin_remote_logins { get; set; }
10 | public bool allow_guest_user { get; set; }
11 | public bool allow_open_registration { get; set; }
12 | public bool allow_remote_logins { get; set; }
13 | // "allowed_hosts": [],
14 | // "created_by_id": null,
15 | // "created_date": null,
16 | // "custom_settings": [],
17 |
18 | public string db_version { get; set; }
19 | public string dsp_version { get; set; }
20 | public string editable_profile_fields { get; set; }
21 | public int guest_role_id { get; set; }
22 | public int id { get; set; }
23 | public string install_name { get; set; }
24 | public int install_type { get; set; }
25 |
26 | // "invite_email_service_id": null,
27 | // "invite_email_template_id": null,
28 |
29 | public bool is_guest { get; set; }
30 | public bool is_hosted { get; set; }
31 | public bool is_private { get; set; }
32 | public int last_modified_by_id { get; set; }
33 | public DateTime last_modified_date { get; set; }
34 | public string latest_version { get; set; }
35 |
36 | //"open_reg_email_service_id": null,
37 | //"open_reg_email_template_id": null,
38 | //"open_reg_role_id": null,
39 | //"password_email_service_id": null,
40 | //"password_email_template_id": null,
41 | //"remote_login_providers": null,
42 | //"restricted_verbs": [],
43 |
44 | public string server_os { get; set; }
45 | public bool upgrade_available { get; set; }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/PublishedEntityBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace OpenNETCF.ORM.SqlServer.Integration.Test.Entities
8 | {
9 | public abstract class PublishedEntityBase
10 | {
11 | public PublishedEntityBase()
12 | {
13 | }
14 |
15 | public PublishedEntityBase(Guid publishID, int clientID, int portfolioID, int engineID)
16 | {
17 | if (publishID == Guid.Empty)
18 | {
19 | this.PublishID = Guid.NewGuid();
20 | }
21 | else
22 | {
23 | this.PublishID = publishID;
24 | }
25 |
26 | RecordDateUtc = DateTime.Now.ToUniversalTime();
27 |
28 | this.EngineID = engineID;
29 | this.ClientID = clientID;
30 | this.PortfolioID = portfolioID;
31 | }
32 |
33 | [Field(IsPrimaryKey = true)]
34 | public Guid PublishID { get; set; }
35 |
36 | [Field]
37 | public int EngineID { get; set; }
38 |
39 | ///
40 | /// Time recorded at the building
41 | ///
42 | [Field(SearchOrder = FieldSearchOrder.Descending)]
43 | public DateTime RecordDateUtc { get; set; }
44 |
45 | ///
46 | /// Time it was stored at the server
47 | ///
48 | [Field]
49 | public DateTime StoredDateUtc { get; set; }
50 |
51 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
52 | public int ClientID { get; set; }
53 |
54 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
55 | public int PortfolioID { get; set; }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/MySQL/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Core/Attributes/ReferenceAttributeCollection.cs:
--------------------------------------------------------------------------------
1 | #if WINDOWS_PHONE
2 | using HASH = System.Security.Cryptography.AesManaged;
3 | #else
4 | using HASH = System.Security.Cryptography.MD5;
5 | #endif
6 |
7 | using System;
8 | using System.Linq;
9 | using System.Collections.Generic;
10 | using System.Text;
11 | using System.Diagnostics;
12 | using System.Security.Cryptography;
13 |
14 |
15 | namespace OpenNETCF.ORM
16 | {
17 | public class ReferenceAttributeCollection : IEnumerable
18 | {
19 | private HASH m_hash;
20 | private Dictionary m_references = new Dictionary();
21 |
22 | internal ReferenceAttributeCollection()
23 | {
24 | #if WINDOWS_PHONE
25 | m_hash = new HASH();
26 | #else
27 | m_hash = HASH.Create();
28 | #endif
29 | }
30 |
31 | internal void Add(ReferenceAttribute reference)
32 | {
33 | m_references.Add(reference.GenerateHash(), reference);
34 | }
35 |
36 | public int Count
37 | {
38 | get { return m_references.Count; }
39 | }
40 |
41 | public ReferenceAttribute this[Type referenceType, string referenceName, string referenceFieldName]
42 | {
43 | get
44 | {
45 | var hash = string.Format("{0}{1}{2}", referenceName, referenceType.Name, referenceFieldName);
46 | return m_references[hash];
47 | }
48 | }
49 |
50 | public IEnumerator GetEnumerator()
51 | {
52 | return m_references.Values.GetEnumerator();
53 | }
54 |
55 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
56 | {
57 | return m_references.Values.GetEnumerator();
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Core/EventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Reflection;
6 | using System.Diagnostics;
7 |
8 | namespace OpenNETCF.ORM
9 | {
10 | public class EntityTypeAddedArgs : EventArgs
11 | {
12 | internal EntityTypeAddedArgs(IEntityInfo info)
13 | {
14 | EntityInfo = info;
15 | }
16 |
17 | public IEntityInfo EntityInfo { get; set; }
18 | }
19 |
20 | public class EntityUpdateArgs : EventArgs
21 | {
22 | internal EntityUpdateArgs(string entityName, object item, bool cascadeUpdates, string fieldName)
23 | {
24 | EntityName = entityName;
25 | Item = item;
26 | CascadeUpdates = cascadeUpdates;
27 | FieldName = fieldName;
28 | }
29 |
30 | public string EntityName { get; set; }
31 | public object Item { get; set; }
32 | public bool CascadeUpdates { get; set; }
33 | public string FieldName { get; set; }
34 | }
35 |
36 | public class EntityInsertArgs : EventArgs
37 | {
38 | internal EntityInsertArgs(string entityName, object item, bool insertReferences)
39 | {
40 | EntityName = entityName;
41 | Item = item;
42 | InsertReferences = insertReferences;
43 | }
44 |
45 | public string EntityName { get; set; }
46 | public object Item { get; set; }
47 | public bool InsertReferences { get; set; }
48 | }
49 |
50 | public class EntityDeleteArgs : EventArgs
51 | {
52 | internal EntityDeleteArgs(string entityName, object item)
53 | {
54 | EntityName = entityName;
55 | Item = item;
56 | }
57 |
58 | public string EntityName { get; set; }
59 | public object Item { get; set; }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Azure Tables/Library/AzureFieldCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Net;
6 | using System.IO;
7 | using System.Xml.Linq;
8 | using System.Globalization;
9 | using System.Security.Cryptography;
10 | using System.Text.RegularExpressions;
11 | using System.Collections.Specialized;
12 |
13 | namespace OpenNETCF.Azure
14 | {
15 | public class AzureFieldCollection : IEnumerable
16 | {
17 | private OrderedDictionary m_fields;
18 |
19 | internal AzureFieldCollection()
20 | {
21 | m_fields = new OrderedDictionary(StringComparer.InvariantCultureIgnoreCase);
22 | }
23 |
24 | public AzureField this[int index]
25 | {
26 | get { return m_fields[index]; }
27 | }
28 |
29 | public AzureField this[string name]
30 | {
31 | get { return m_fields[name]; }
32 | }
33 |
34 | public void Add(string fieldName, object value)
35 | {
36 | Add(new AzureField(fieldName, value));
37 | }
38 |
39 | public void Add(AzureField field)
40 | {
41 | m_fields.Add(field.Name, field);
42 | }
43 |
44 | public int Count
45 | {
46 | get { return m_fields.Count; }
47 | }
48 |
49 | public IEnumerator GetEnumerator()
50 | {
51 | return m_fields.Values.GetEnumerator();
52 | }
53 |
54 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
55 | {
56 | return GetEnumerator();
57 | }
58 |
59 | internal static AzureFieldCollection FromATOMFeed(XElement feedElement)
60 | {
61 | throw new NotImplementedException();
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("OpenNETCF.ORM.TestHarness.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("Microsoft")]
13 | [assembly: AssemblyProduct("OpenNETCF.ORM.TestHarness.Android")]
14 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("a557ce8c-9dbe-4b93-8fc4-95ffc126cf14")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Build and Revision Numbers
34 | // by using the '*' as shown below:
35 | // [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyVersion("1.0.0.0")]
37 | [assembly: AssemblyFileVersion("1.0.0.0")]
38 |
39 | // Add some common permissions, these can be removed if not needed
40 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
41 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
42 |
--------------------------------------------------------------------------------
/Samples/ReferenceSample/Entities/Customer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using OpenNETCF.ORM;
6 |
7 | namespace ReferenceSample.Entities
8 | {
9 | [Entity(KeyScheme.Identity)]
10 | public class Customer
11 | {
12 | [Field(IsPrimaryKey = true)]
13 | public int CustomerID { get; set; }
14 |
15 | [Field]
16 | public string Name { get; set; }
17 |
18 | [Reference(typeof(ProductOrder), "CustomerID", ReferenceType=ReferenceType.OneToMany)]
19 | public ProductOrder[] Orders { get; set; }
20 | }
21 |
22 | [Entity(KeyScheme.Identity)]
23 | public class ProductOrder
24 | {
25 | public ProductOrder()
26 | {
27 | // this is required for cascading inserts to work
28 | OrderID = -1;
29 | }
30 |
31 | [Field(IsPrimaryKey = true)]
32 | public int OrderID { get; set; }
33 |
34 | [Field] // this is the foreign key
35 | public int CustomerID { get; set; }
36 |
37 | [Field]
38 | public string InvoiceNumber { get; set; }
39 | }
40 |
41 | [Entity(KeyScheme.Identity)]
42 | public class ShipAddress
43 | {
44 | [Field(IsPrimaryKey = true)]
45 | public int AddressID { get; set; }
46 |
47 | [Field]
48 | public string Street { get; set; }
49 |
50 | [Reference(typeof(State), "StateID", ReferenceType = ReferenceType.ManyToOne)]
51 | public State State { get; set; }
52 | }
53 |
54 | [Entity(KeyScheme.Identity)]
55 | public class State
56 | {
57 | [Field(IsPrimaryKey = true)]
58 | public int StateID { get; set; }
59 |
60 | [Field]
61 | public string Name { get; set; }
62 |
63 | [Field]
64 | public string Abbreviation { get; set; }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Azure Tables/Library/Exceptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Net;
6 | using System.IO;
7 | using System.Xml.Linq;
8 | using System.Globalization;
9 | using System.Security.Cryptography;
10 | using System.Text.RegularExpressions;
11 | using System.Collections.Specialized;
12 |
13 | namespace OpenNETCF.Azure
14 | {
15 | public class TableNotFoundException : Exception
16 | {
17 | private string m_table;
18 |
19 | public TableNotFoundException(string tableName)
20 | {
21 | m_table = tableName;
22 | }
23 |
24 | public override string Message
25 | {
26 | get { return string.Format("Table '{0}' not found.", m_table); }
27 | }
28 | }
29 |
30 | public class EntityAlreadyExistsException : Exception
31 | {
32 | public EntityAlreadyExistsException()
33 | {
34 | }
35 |
36 | public override string Message
37 | {
38 | get { return "A matching entity already exists in the target table."; }
39 | }
40 | }
41 | }
42 |
43 | namespace OpenNETCF.WindowsAzure.StorageClient
44 | {
45 | using OpenNETCF.Azure;
46 |
47 | public class StorageException : Exception
48 | {
49 | public string ErrorCode { get; private set; }
50 | public string ExtendedErrorInformation { get; private set; }
51 | public HttpStatusCode StatusCode { get; private set; }
52 |
53 | internal StorageException(HttpStatusCode status, XDocument errorDocument)
54 | {
55 | this.StatusCode = status;
56 | var e = errorDocument.Element(Namespaces.DataServicesMeta + "error");
57 | this.ErrorCode = e.Element(Namespaces.DataServicesMeta + "code").Value;
58 | this.ExtendedErrorInformation = e.Element(Namespaces.DataServicesMeta + "message").Value;
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/SQL Server/Extensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace OpenNETCF.ORM.SqlServer
8 | {
9 | internal static class Extensions
10 | {
11 | public static SqlDbType ToSqlDbType(this DbType sourceType)
12 | {
13 | switch (sourceType)
14 | {
15 | case DbType.Int32:
16 | case DbType.UInt32:
17 | return SqlDbType.Int;
18 | case DbType.Int64:
19 | case DbType.UInt64:
20 | return SqlDbType.BigInt;
21 | case DbType.Int16:
22 | case DbType.UInt16:
23 | return SqlDbType.SmallInt;
24 | case DbType.Boolean:
25 | return SqlDbType.Bit;
26 | case DbType.String:
27 | case DbType.StringFixedLength:
28 | return SqlDbType.NVarChar;
29 | case DbType.Single:
30 | case DbType.Decimal:
31 | return SqlDbType.Decimal;
32 | case DbType.Double:
33 | return SqlDbType.Float;
34 | case DbType.DateTime2:
35 | case DbType.Date:
36 | case DbType.DateTime:
37 | return SqlDbType.DateTime;
38 | case DbType.Time:
39 | return SqlDbType.Time;
40 | case DbType.Guid:
41 | return SqlDbType.UniqueIdentifier;
42 | default:
43 | throw new NotSupportedException();
44 | }
45 | }
46 |
47 | public static string Truncate(this string value, int maxLength)
48 | {
49 | if (string.IsNullOrEmpty(value)) return value;
50 | return value.Length <= maxLength ? value : value.Substring(0, maxLength);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.TestHarness.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (Main.xml),
7 | an internationalization string table (Strings.xml) and some icons (drawable/Icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | Drawable/
12 | Icon.png
13 |
14 | Layout/
15 | Main.axml
16 |
17 | Values/
18 | Strings.xml
19 |
20 | In order to get the build system to recognize Android resources, the build action should be set
21 | to "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called
24 | "Resource" that contains the tokens for each one of the resources included. For example,
25 | for the above Resources layout, this is what the Resource class would expose:
26 |
27 | public class Resource {
28 | public class Drawable {
29 | public const int Icon = 0x123;
30 | }
31 |
32 | public class Layout {
33 | public const int Main = 0x456;
34 | }
35 |
36 | public class String {
37 | public const int FirstString = 0xabc;
38 | public const int SecondString = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use Resource.Drawable.Icon to reference the Drawable/Icon.png file, or
43 | Resource.Layout.Main to reference the Layout/Main.axml file, or Resource.String.FirstString
44 | to reference the first string in the dictionary file Values/Strings.xml.
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Entities/Author.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data.SqlServerCe;
6 | using System.Data;
7 |
8 | namespace OpenNETCF.ORM.Test.Entities
9 | {
10 | [Entity(KeyScheme.Identity)]
11 | public class Author
12 | {
13 | private static Dictionary m_nameToOrdinalMap;
14 |
15 | private static Author ORM_CreateProxy(FieldAttributeCollection fields, IDataReader results)
16 | {
17 | if (m_nameToOrdinalMap == null)
18 | {
19 | m_nameToOrdinalMap = new Dictionary();
20 |
21 | foreach (var field in fields)
22 | {
23 | m_nameToOrdinalMap.Add(field.FieldName, results.GetOrdinal(field.FieldName));
24 | }
25 | }
26 |
27 | var item = new Author();
28 |
29 | foreach (var field in fields)
30 | {
31 | var value = results[field.Ordinal];
32 | // var value = results[results.GetOrdinal(field.FieldName)];
33 | var val = results[m_nameToOrdinalMap[field.FieldName]];
34 |
35 | switch (field.FieldName)
36 | {
37 | case "Name":
38 | item.Name = value == DBNull.Value ? null : (string)value;
39 | break;
40 | // fill in any additional properties here
41 | }
42 | }
43 |
44 | return item;
45 | }
46 |
47 | [Field(IsPrimaryKey = true)]
48 | public int AuthorID { get; set; }
49 |
50 | [Reference(typeof(Book), "AuthorID", Autofill = true)]
51 | public Book[] Books { get; set; }
52 |
53 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
54 | public string Name { get; set; }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Core/OpenNETCF.ORM.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7
5 | OpenNETCF.ORM
6 | OpenNETCF.ORM
7 | false
8 | 1.0.23048
9 | 1.0.23048
10 | MIT-0
11 | https://github.com/ctacke/orm
12 | The core bits OpenNETCF's ORM Framework with no storage implementation
13 | 2016-2023
14 | https://github.com/ctacke/orm
15 | ORM; OpenNETCF
16 | opennetcf-orm-core
17 | OpenNETCF ORM Core
18 | 1.0.23048
19 |
20 |
21 |
22 | ..\..\bin\Core\Debug\
23 |
24 |
25 |
26 | ..\..\bin\Core\Release\
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/Entities/TestTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum TestEnum
9 | {
10 | ValueA,
11 | ValueB,
12 | ValueC
13 | }
14 |
15 | [Entity(KeyScheme.Identity)]
16 | public class TestTable
17 | {
18 | [Field(IsPrimaryKey = true)]
19 | public int TestID { get; set; }
20 |
21 | [Field(Length=200)]
22 | public byte[] ShortBinary { get; set; }
23 |
24 | [Field(Length = 20000)]
25 | public byte[] LongBinary { get; set; }
26 |
27 | [Field]
28 | public TestEnum EnumField { get; set; }
29 |
30 | [Field]
31 | public CustomObject CustomObject { get; set; }
32 |
33 | // ORM-required serialization routines for any Object Field
34 | public byte[] Serialize(string fieldName)
35 | {
36 | if (fieldName == "CustomObject")
37 | {
38 | // This will always be true in this case since CustomObject is our only
39 | // Object Field. The "if" block could be omitted, but for sample
40 | // clarity I'm keeping it
41 | if (this.CustomObject == null) return null;
42 | return this.CustomObject.AsByteArray();
43 | }
44 |
45 | throw new NotSupportedException();
46 | }
47 |
48 | public object Deserialize(string fieldName, byte[] data)
49 | {
50 | if (fieldName == "CustomObject")
51 | {
52 | // This will always be true in this case since CustomObject is our only
53 | // Object Field. The "if" block could be omitted, but for sample
54 | // clarity I'm keeping it
55 | return new CustomObject(data);
56 | }
57 |
58 | throw new NotSupportedException();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/Entities/TestTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum TestEnum
9 | {
10 | ValueA,
11 | ValueB,
12 | ValueC
13 | }
14 |
15 | [Entity(KeyScheme.Identity)]
16 | public class TestTable
17 | {
18 | [Field(IsPrimaryKey = true)]
19 | public int TestID { get; set; }
20 |
21 | [Field(Length=200)]
22 | public byte[] ShortBinary { get; set; }
23 |
24 | [Field(Length = 20000)]
25 | public byte[] LongBinary { get; set; }
26 |
27 | [Field]
28 | public TestEnum EnumField { get; set; }
29 |
30 | [Field]
31 | public CustomObject CustomObject { get; set; }
32 |
33 | // ORM-required serialization routines for any Object Field
34 | public byte[] Serialize(string fieldName)
35 | {
36 | if (fieldName == "CustomObject")
37 | {
38 | // This will always be true in this case since CustomObject is our only
39 | // Object Field. The "if" block could be omitted, but for sample
40 | // clarity I'm keeping it
41 | if (this.CustomObject == null) return null;
42 | return this.CustomObject.AsByteArray();
43 | }
44 |
45 | throw new NotSupportedException();
46 | }
47 |
48 | public object Deserialize(string fieldName, byte[] data)
49 | {
50 | if (fieldName == "CustomObject")
51 | {
52 | // This will always be true in this case since CustomObject is our only
53 | // Object Field. The "if" block could be omitted, but for sample
54 | // clarity I'm keeping it
55 | return new CustomObject(data);
56 | }
57 |
58 | throw new NotSupportedException();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/Entities/TestTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum TestEnum
9 | {
10 | ValueA,
11 | ValueB,
12 | ValueC
13 | }
14 |
15 | [Entity(KeyScheme.Identity)]
16 | public class TestTable
17 | {
18 | [Field(IsPrimaryKey = true)]
19 | public int TestID { get; set; }
20 |
21 | [Field(Length=200)]
22 | public byte[] ShortBinary { get; set; }
23 |
24 | [Field(Length = 20000)]
25 | public byte[] LongBinary { get; set; }
26 |
27 | [Field]
28 | public TestEnum EnumField { get; set; }
29 |
30 | [Field]
31 | public CustomObject CustomObject { get; set; }
32 |
33 | // ORM-required serialization routines for any Object Field
34 | public byte[] Serialize(string fieldName)
35 | {
36 | if (fieldName == "CustomObject")
37 | {
38 | // This will always be true in this case since CustomObject is our only
39 | // Object Field. The "if" block could be omitted, but for sample
40 | // clarity I'm keeping it
41 | if (this.CustomObject == null) return null;
42 | return this.CustomObject.AsByteArray();
43 | }
44 |
45 | throw new NotSupportedException();
46 | }
47 |
48 | public object Deserialize(string fieldName, byte[] data)
49 | {
50 | if (fieldName == "CustomObject")
51 | {
52 | // This will always be true in this case since CustomObject is our only
53 | // Object Field. The "if" block could be omitted, but for sample
54 | // clarity I'm keeping it
55 | return new CustomObject(data);
56 | }
57 |
58 | throw new NotSupportedException();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Entities/TestTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum TestEnum
9 | {
10 | ValueA,
11 | ValueB,
12 | ValueC
13 | }
14 |
15 | [Entity(KeyScheme.Identity)]
16 | public class TestTable
17 | {
18 | [Field(IsPrimaryKey = true)]
19 | public int TestID { get; set; }
20 |
21 | [Field(Length=200)]
22 | public byte[] ShortBinary { get; set; }
23 |
24 | [Field(Length = 20000)]
25 | public byte[] LongBinary { get; set; }
26 |
27 | [Field]
28 | public TestEnum EnumField { get; set; }
29 |
30 | [Field]
31 | public CustomObject CustomObject { get; set; }
32 |
33 | // ORM-required serialization routines for any Object Field
34 | public byte[] Serialize(string fieldName)
35 | {
36 | if (fieldName == "CustomObject")
37 | {
38 | // This will always be true in this case since CustomObject is our only
39 | // Object Field. The "if" block could be omitted, but for sample
40 | // clarity I'm keeping it
41 | if (this.CustomObject == null) return null;
42 | return this.CustomObject.AsByteArray();
43 | }
44 |
45 | throw new NotSupportedException();
46 | }
47 |
48 | public object Deserialize(string fieldName, byte[] data)
49 | {
50 | if (fieldName == "CustomObject")
51 | {
52 | // This will always be true in this case since CustomObject is our only
53 | // Object Field. The "if" block could be omitted, but for sample
54 | // clarity I'm keeping it
55 | return new CustomObject(data);
56 | }
57 |
58 | throw new NotSupportedException();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/TestTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public enum TestEnum
9 | {
10 | ValueA,
11 | ValueB,
12 | ValueC
13 | }
14 |
15 | [Entity(KeyScheme.Identity)]
16 | public class TestTable
17 | {
18 | [Field(IsPrimaryKey = true)]
19 | public int TestID { get; set; }
20 |
21 | [Field(Length=200)]
22 | public byte[] ShortBinary { get; set; }
23 |
24 | [Field(Length = 20000)]
25 | public byte[] LongBinary { get; set; }
26 |
27 | [Field]
28 | public TestEnum EnumField { get; set; }
29 |
30 | [Field]
31 | public CustomObject CustomObject { get; set; }
32 |
33 | // ORM-required serialization routines for any Object Field
34 | public byte[] Serialize(string fieldName)
35 | {
36 | if (fieldName == "CustomObject")
37 | {
38 | // This will always be true in this case since CustomObject is our only
39 | // Object Field. The "if" block could be omitted, but for sample
40 | // clarity I'm keeping it
41 | if (this.CustomObject == null) return null;
42 | return this.CustomObject.AsByteArray();
43 | }
44 |
45 | throw new NotSupportedException();
46 | }
47 |
48 | public object Deserialize(string fieldName, byte[] data)
49 | {
50 | if (fieldName == "CustomObject")
51 | {
52 | // This will always be true in this case since CustomObject is our only
53 | // Object Field. The "if" block could be omitted, but for sample
54 | // clarity I'm keeping it
55 | return new CustomObject(data);
56 | }
57 |
58 | throw new NotSupportedException();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Test/Entities/CustomObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public class CustomObject
9 | {
10 | public string ObjectName { get; set; }
11 | public Guid Identifier { get; set; }
12 | public int SomeIntProp { get; set; }
13 |
14 | public CustomObject()
15 | {
16 | }
17 |
18 | public CustomObject(byte[] data)
19 | {
20 | // deserialization ctor
21 | int offset = 0;
22 |
23 | // get the name length
24 | var nameLength = BitConverter.ToInt32(data, offset);
25 |
26 | // get the name bytes
27 | offset += 4; // past the length
28 | this.ObjectName = Encoding.ASCII.GetString(data, offset, nameLength);
29 |
30 | // get the GUID
31 | offset += nameLength;
32 | byte[] guidData = new byte[16];
33 | // we must copy the data since Guid doesn't have a ctor that allows us to specify an offset
34 | Buffer.BlockCopy(data, offset, guidData, 0, guidData.Length);
35 | this.Identifier = new Guid(guidData);
36 |
37 | // get the int property
38 | offset += guidData.Length;
39 | this.SomeIntProp = BitConverter.ToInt32(data, offset);
40 | }
41 |
42 | public byte[] AsByteArray()
43 | {
44 | List buffer = new List();
45 |
46 | byte[] nameData = Encoding.ASCII.GetBytes(this.ObjectName);
47 |
48 | // store the name length
49 | buffer.AddRange(BitConverter.GetBytes(nameData.Length));
50 |
51 | // store the name data
52 | buffer.AddRange(nameData);
53 |
54 | // store the GUID
55 | buffer.AddRange(this.Identifier.ToByteArray());
56 |
57 | // store the IntProp
58 | buffer.AddRange(BitConverter.GetBytes(this.SomeIntProp));
59 |
60 | return buffer.ToArray();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/OpenNETCF.ORM.FFx.VS11.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 11
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenNETCF.ORM.FFx.VS11", "OpenNETCF.ORM\OpenNETCF.ORM.FFx.VS11.csproj", "{6E9C7DA3-AD60-4E44-9D3A-7BBD3A20D79F}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenNETCF.ORM.SqlCe.FFx.VS11", "OpenNETCF.ORM.SqlCe\OpenNETCF.ORM.SqlCe.FFx.VS11.csproj", "{B63F2DF8-E247-402D-A250-2514EF4A08FD}"
7 | EndProject
8 | Global
9 | GlobalSection(TeamFoundationVersionControl) = preSolution
10 | SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
11 | SccLocalPath0 = .
12 | SccLocalPath1 = OpenNETCF.ORM.SqlCe
13 | SccLocalPath2 = OpenNETCF.ORM
14 | SccNumberOfProjects = 3
15 | SccProjectName1 = OpenNETCF.ORM.SqlCe
16 | SccProjectName2 = OpenNETCF.ORM
17 | SccProjectUniqueName1 = OpenNETCF.ORM.SqlCe\\OpenNETCF.ORM.SqlCe.FFx.VS11.csproj
18 | SccProjectUniqueName2 = OpenNETCF.ORM\\OpenNETCF.ORM.FFx.VS11.csproj
19 | SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs01
20 | EndGlobalSection
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Release|Any CPU = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {6E9C7DA3-AD60-4E44-9D3A-7BBD3A20D79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {6E9C7DA3-AD60-4E44-9D3A-7BBD3A20D79F}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {6E9C7DA3-AD60-4E44-9D3A-7BBD3A20D79F}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {6E9C7DA3-AD60-4E44-9D3A-7BBD3A20D79F}.Release|Any CPU.Build.0 = Release|Any CPU
30 | {B63F2DF8-E247-402D-A250-2514EF4A08FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31 | {B63F2DF8-E247-402D-A250-2514EF4A08FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
32 | {B63F2DF8-E247-402D-A250-2514EF4A08FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {B63F2DF8-E247-402D-A250-2514EF4A08FD}.Release|Any CPU.Build.0 = Release|Any CPU
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.MySQL.Integration.Test/Entities/CustomObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public class CustomObject
9 | {
10 | public string ObjectName { get; set; }
11 | public Guid Identifier { get; set; }
12 | public int SomeIntProp { get; set; }
13 |
14 | public CustomObject()
15 | {
16 | }
17 |
18 | public CustomObject(byte[] data)
19 | {
20 | // deserialization ctor
21 | int offset = 0;
22 |
23 | // get the name length
24 | var nameLength = BitConverter.ToInt32(data, offset);
25 |
26 | // get the name bytes
27 | offset += 4; // past the length
28 | this.ObjectName = Encoding.ASCII.GetString(data, offset, nameLength);
29 |
30 | // get the GUID
31 | offset += nameLength;
32 | byte[] guidData = new byte[16];
33 | // we must copy the data since Guid doesn't have a ctor that allows us to specify an offset
34 | Buffer.BlockCopy(data, offset, guidData, 0, guidData.Length);
35 | this.Identifier = new Guid(guidData);
36 |
37 | // get the int property
38 | offset += guidData.Length;
39 | this.SomeIntProp = BitConverter.ToInt32(data, offset);
40 | }
41 |
42 | public byte[] AsByteArray()
43 | {
44 | List buffer = new List();
45 |
46 | byte[] nameData = Encoding.ASCII.GetBytes(this.ObjectName);
47 |
48 | // store the name length
49 | buffer.AddRange(BitConverter.GetBytes(nameData.Length));
50 |
51 | // store the name data
52 | buffer.AddRange(nameData);
53 |
54 | // store the GUID
55 | buffer.AddRange(this.Identifier.ToByteArray());
56 |
57 | // store the IntProp
58 | buffer.AddRange(BitConverter.GetBytes(this.SomeIntProp));
59 |
60 | return buffer.ToArray();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Oracle.Integration.Test/Entities/CustomObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public class CustomObject
9 | {
10 | public string ObjectName { get; set; }
11 | public Guid Identifier { get; set; }
12 | public int SomeIntProp { get; set; }
13 |
14 | public CustomObject()
15 | {
16 | }
17 |
18 | public CustomObject(byte[] data)
19 | {
20 | // deserialization ctor
21 | int offset = 0;
22 |
23 | // get the name length
24 | var nameLength = BitConverter.ToInt32(data, offset);
25 |
26 | // get the name bytes
27 | offset += 4; // past the length
28 | this.ObjectName = Encoding.ASCII.GetString(data, offset, nameLength);
29 |
30 | // get the GUID
31 | offset += nameLength;
32 | byte[] guidData = new byte[16];
33 | // we must copy the data since Guid doesn't have a ctor that allows us to specify an offset
34 | Buffer.BlockCopy(data, offset, guidData, 0, guidData.Length);
35 | this.Identifier = new Guid(guidData);
36 |
37 | // get the int property
38 | offset += guidData.Length;
39 | this.SomeIntProp = BitConverter.ToInt32(data, offset);
40 | }
41 |
42 | public byte[] AsByteArray()
43 | {
44 | List buffer = new List();
45 |
46 | byte[] nameData = Encoding.ASCII.GetBytes(this.ObjectName);
47 |
48 | // store the name length
49 | buffer.AddRange(BitConverter.GetBytes(nameData.Length));
50 |
51 | // store the name data
52 | buffer.AddRange(nameData);
53 |
54 | // store the GUID
55 | buffer.AddRange(this.Identifier.ToByteArray());
56 |
57 | // store the IntProp
58 | buffer.AddRange(BitConverter.GetBytes(this.SomeIntProp));
59 |
60 | return buffer.ToArray();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/Entities/CustomObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public class CustomObject
9 | {
10 | public string ObjectName { get; set; }
11 | public Guid Identifier { get; set; }
12 | public int SomeIntProp { get; set; }
13 |
14 | public CustomObject()
15 | {
16 | }
17 |
18 | public CustomObject(byte[] data)
19 | {
20 | // deserialization ctor
21 | int offset = 0;
22 |
23 | // get the name length
24 | var nameLength = BitConverter.ToInt32(data, offset);
25 |
26 | // get the name bytes
27 | offset += 4; // past the length
28 | this.ObjectName = Encoding.ASCII.GetString(data, offset, nameLength);
29 |
30 | // get the GUID
31 | offset += nameLength;
32 | byte[] guidData = new byte[16];
33 | // we must copy the data since Guid doesn't have a ctor that allows us to specify an offset
34 | Buffer.BlockCopy(data, offset, guidData, 0, guidData.Length);
35 | this.Identifier = new Guid(guidData);
36 |
37 | // get the int property
38 | offset += guidData.Length;
39 | this.SomeIntProp = BitConverter.ToInt32(data, offset);
40 | }
41 |
42 | public byte[] AsByteArray()
43 | {
44 | List buffer = new List();
45 |
46 | byte[] nameData = Encoding.ASCII.GetBytes(this.ObjectName);
47 |
48 | // store the name length
49 | buffer.AddRange(BitConverter.GetBytes(nameData.Length));
50 |
51 | // store the name data
52 | buffer.AddRange(nameData);
53 |
54 | // store the GUID
55 | buffer.AddRange(this.Identifier.ToByteArray());
56 |
57 | // store the IntProp
58 | buffer.AddRange(BitConverter.GetBytes(this.SomeIntProp));
59 |
60 | return buffer.ToArray();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlServer.Integration.Test/Entities/CustomObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM.Test.Entities
7 | {
8 | public class CustomObject
9 | {
10 | public string ObjectName { get; set; }
11 | public Guid Identifier { get; set; }
12 | public int SomeIntProp { get; set; }
13 |
14 | public CustomObject()
15 | {
16 | }
17 |
18 | public CustomObject(byte[] data)
19 | {
20 | // deserialization ctor
21 | int offset = 0;
22 |
23 | // get the name length
24 | var nameLength = BitConverter.ToInt32(data, offset);
25 |
26 | // get the name bytes
27 | offset += 4; // past the length
28 | this.ObjectName = Encoding.ASCII.GetString(data, offset, nameLength);
29 |
30 | // get the GUID
31 | offset += nameLength;
32 | byte[] guidData = new byte[16];
33 | // we must copy the data since Guid doesn't have a ctor that allows us to specify an offset
34 | Buffer.BlockCopy(data, offset, guidData, 0, guidData.Length);
35 | this.Identifier = new Guid(guidData);
36 |
37 | // get the int property
38 | offset += guidData.Length;
39 | this.SomeIntProp = BitConverter.ToInt32(data, offset);
40 | }
41 |
42 | public byte[] AsByteArray()
43 | {
44 | List buffer = new List();
45 |
46 | byte[] nameData = Encoding.ASCII.GetBytes(this.ObjectName);
47 |
48 | // store the name length
49 | buffer.AddRange(BitConverter.GetBytes(nameData.Length));
50 |
51 | // store the name data
52 | buffer.AddRange(nameData);
53 |
54 | // store the GUID
55 | buffer.AddRange(this.Identifier.ToByteArray());
56 |
57 | // store the IntProp
58 | buffer.AddRange(BitConverter.GetBytes(this.SomeIntProp));
59 |
60 | return buffer.ToArray();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/TraceAndTestImpact.testsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 | These are test settings for Trace and Test Impact.
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Core/Dynamics/DynamicEntityDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace OpenNETCF.ORM
7 | {
8 | public class DynamicEntityDefinition : SqlEntityInfo, ICloneable
9 | {
10 | public DynamicEntityDefinition()
11 | : this(null, null)
12 | {
13 | }
14 |
15 | public DynamicEntityDefinition(string entityName, IEnumerable fields)
16 | : this(entityName, fields, KeyScheme.None)
17 | {
18 | }
19 |
20 | public DynamicEntityDefinition(string entityName, IEnumerable fields, KeyScheme keyScheme)
21 | {
22 | var entityAttribute = new EntityAttribute(keyScheme);
23 | entityAttribute.NameInStore = entityName;
24 |
25 | this.EntityType = typeof(DynamicEntityDefinition);
26 | this.Initialize(entityAttribute, this.EntityType);
27 | this.Fields.AddRange(fields);
28 |
29 | var k = this.Fields.FirstOrDefault(c => c.IsPrimaryKey);
30 | if (k != null)
31 | {
32 | this.PrimaryKeyColumnName = k.FieldName;
33 | }
34 | }
35 |
36 | private DynamicEntityDefinition(DynamicEntityDefinition source)
37 | {
38 | var entityAttribute = new EntityAttribute(source.EntityAttribute.KeyScheme);
39 | entityAttribute.NameInStore = source.EntityAttribute.NameInStore;
40 |
41 | this.EntityType = typeof(DynamicEntityDefinition);
42 | this.Initialize(entityAttribute, this.EntityType);
43 |
44 | // TODO make a copy of these?
45 | this.Fields.AddRange(source.Fields);
46 |
47 | var k = this.Fields.FirstOrDefault(c => c.IsPrimaryKey);
48 | if (k != null)
49 | {
50 | this.PrimaryKeyColumnName = k.FieldName;
51 | }
52 | }
53 |
54 | object ICloneable.Clone()
55 | {
56 | return this.Clone();
57 | }
58 |
59 | public DynamicEntityDefinition Clone()
60 | {
61 | return new DynamicEntityDefinition(this);
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/BinaryData.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.5456
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace OpenNETCF.ORM
12 | {
13 | using System;
14 | using OpenNETCF.ORM;
15 | using System.Data;
16 |
17 |
18 | [Entity(KeyScheme.Identity)]
19 | public class BinaryData
20 | {
21 |
22 | private int m_id;
23 |
24 | private byte[] m_binaryfield;
25 |
26 | private byte[] m_imagefield;
27 |
28 | private string m_ntextfield;
29 |
30 | [Field(IsPrimaryKey=true, SearchOrder=FieldSearchOrder.Ascending)]
31 | public int ID
32 | {
33 | get
34 | {
35 | return this.m_id;
36 | }
37 | set
38 | {
39 | this.m_id = value;
40 | }
41 | }
42 |
43 | [Field()]
44 | public byte[] BinaryField
45 | {
46 | get
47 | {
48 | return this.m_binaryfield;
49 | }
50 | set
51 | {
52 | this.m_binaryfield = value;
53 | }
54 | }
55 |
56 | [Field()]
57 | public byte[] ImageField
58 | {
59 | get
60 | {
61 | return this.m_imagefield;
62 | }
63 | set
64 | {
65 | this.m_imagefield = value;
66 | }
67 | }
68 |
69 | [Field()]
70 | public string NTextField
71 | {
72 | get
73 | {
74 | return this.m_ntextfield;
75 | }
76 | set
77 | {
78 | this.m_ntextfield = value;
79 | }
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Samples/SQLiteNorthwind/Entities/Regions.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.5456
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace OpenNETCF.ORM
12 | {
13 | using System;
14 | using OpenNETCF.ORM;
15 |
16 |
17 | [Entity(KeyScheme.None)]
18 | public class Regions
19 | {
20 |
21 | private static Regions ORM_CreateProxy(OpenNETCF.ORM.FieldAttributeCollection fields, System.Data.IDataReader results)
22 | {
23 | var item = new Regions();
24 | foreach(var field in fields){
25 | var value = results[field.Ordinal];
26 | switch(field.FieldName){
27 | case "RegionID":
28 | // If this is a TimeSpan, use the commented line below
29 | // item.RegionID = (value == DBNull.Value) ? TimeSpan.MinValue; : new TimeSpan((long)value);
30 | item.RegionID = (value == DBNull.Value) ? 0 : (long)value;
31 | break;
32 | case "RegionDescription":
33 | item.RegionDescription = (value == DBNull.Value) ? null : (string)value;
34 | break;
35 | }
36 | }
37 | return item;
38 | }
39 |
40 | private long m_regionid;
41 |
42 | private string m_regiondescription;
43 |
44 | [Field(IsPrimaryKey=true)]
45 | public long RegionID
46 | {
47 | get
48 | {
49 | return this.m_regionid;
50 | }
51 | set
52 | {
53 | this.m_regionid = value;
54 | }
55 | }
56 |
57 | [Field()]
58 | public string RegionDescription
59 | {
60 | get
61 | {
62 | return this.m_regiondescription;
63 | }
64 | set
65 | {
66 | this.m_regiondescription = value;
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/ReplicationTests.cs:
--------------------------------------------------------------------------------
1 | using OpenNETCF.ORM;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using System.Linq;
4 | using System;
5 | using System.Text;
6 | using OpenNETCF.ORM.Replication;
7 | using System.Threading;
8 | using System.Diagnostics;
9 |
10 | namespace OpenNETCF.ORM.SqlCE.Integration.Test
11 | {
12 | [TestClass()]
13 | public class ReplicationTests
14 | {
15 | public TestContext TestContext { get; set; }
16 |
17 | [TestMethod()]
18 | public void BasicLocalReplicationTest()
19 | {
20 | var source = new SqlCeDataStore("source.sdf");
21 | if (!source.StoreExists)
22 | {
23 | source.CreateStore();
24 | }
25 | source.AddType();
26 |
27 | var destination = new SqlCeDataStore("dest.sdf");
28 | if (!destination.StoreExists)
29 | {
30 | destination.CreateStore();
31 | }
32 |
33 | // build a replictor to send data to the destiantion store
34 | var replicator = new Replicator(destination, ReplicationBehavior.ReplicateAndDelete);
35 |
36 | // replication is opt-in, so tell it what type(s) we want to replicate
37 | replicator.RegisterEntity();
38 |
39 | // add the replicator to the source
40 | source.Replicators.Add(replicator);
41 |
42 | // watch an event for when data batches go out
43 | replicator.DataReplicated += delegate
44 | {
45 | // get a count
46 | Debug.WriteLine(string.Format("Sent {0} rows", replicator.GetCount()));
47 | };
48 |
49 | var rows = 200;
50 |
51 | // put some data in the source
52 | for (int i = 0; i < rows; i++)
53 | {
54 | var item = new TestItem(string.Format("Item {0}", i));
55 | source.Insert(item);
56 | }
57 |
58 | int remaining = 0;
59 | // loop until the source table is empty
60 | do
61 | {
62 | Thread.Sleep(500);
63 | remaining = source.Count();
64 | } while(remaining > 0);
65 |
66 | // make sure the destination has all rows
67 | Assert.AreEqual(rows, destination.Count());
68 | }
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.SqlCE.Integration.Test/ExtensionTests.cs:
--------------------------------------------------------------------------------
1 | using OpenNETCF.ORM;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using System.Linq;
4 | using System;
5 | using System.Text;
6 |
7 | namespace OpenNETCF.ORM.SqlCE.Integration.Test
8 | {
9 | [TestClass()]
10 | public class ExtensionTests
11 | {
12 | public TestContext TestContext { get; set; }
13 |
14 | [TestMethod()]
15 | public void ParseToIndexInfoTest()
16 | {
17 | // CREATE INDEX idx_Foo ON TableX (ColumnA, ColumnB, ColumnC) ASC
18 | // CREATE INDEX idx_Foo ON TableX (ColumnA, ColumnB) DESC
19 | // CREATE INDEX idx_Foo ON TableX (ColumnA) DESC
20 | // CREATE INDEX idx_Foo ON TableX (ColumnA)
21 |
22 | var sql = "CREATE INDEX idx_Foo ON TableX(ColumnA, ColumnB, ColumnC) ASC";
23 | var info = sql.ParseToIndexInfo();
24 |
25 | Assert.AreEqual("idx_Foo", info.IndexName);
26 | Assert.AreEqual("TableX", info.TableName);
27 | Assert.AreEqual(3, info.Fields.Length);
28 | Assert.IsTrue(info.IsComposite);
29 | Assert.AreEqual(FieldSearchOrder.Ascending, info.SearchOrder);
30 |
31 | sql = "CREATE INDEX idx_Foo ON TableX (ColumnA, ColumnB) DESC";
32 | info = sql.ParseToIndexInfo();
33 |
34 | Assert.AreEqual("idx_Foo", info.IndexName);
35 | Assert.AreEqual("TableX", info.TableName);
36 | Assert.AreEqual(2, info.Fields.Length);
37 | Assert.IsTrue(info.IsComposite);
38 | Assert.AreEqual(FieldSearchOrder.Descending, info.SearchOrder);
39 |
40 | sql = "create index idx_Foo on TableX (ColumnA) DESC";
41 | info = sql.ParseToIndexInfo();
42 |
43 | Assert.AreEqual("idx_Foo", info.IndexName);
44 | Assert.AreEqual("TableX", info.TableName);
45 | Assert.AreEqual(1, info.Fields.Length);
46 | Assert.IsFalse(info.IsComposite);
47 | Assert.AreEqual(FieldSearchOrder.Descending, info.SearchOrder);
48 |
49 | sql = "create index idx_Foo on TableX (ColumnA)";
50 | info = sql.ParseToIndexInfo();
51 |
52 | Assert.AreEqual("idx_Foo", info.IndexName);
53 | Assert.AreEqual("TableX", info.TableName);
54 | Assert.AreEqual(1, info.Fields.Length);
55 | Assert.IsFalse(info.IsComposite);
56 | Assert.AreEqual(FieldSearchOrder.Ascending, info.SearchOrder);
57 | }
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/EntityGenerator/Views/EditEntitiesView.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EntityGenerator.Views
2 | {
3 | partial class EditEntitiesView
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.SuspendLayout();
33 | //
34 | // label1
35 | //
36 | this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
37 | | System.Windows.Forms.AnchorStyles.Left)
38 | | System.Windows.Forms.AnchorStyles.Right)));
39 | this.label1.Location = new System.Drawing.Point(37, 130);
40 | this.label1.Name = "label1";
41 | this.label1.Size = new System.Drawing.Size(676, 101);
42 | this.label1.TabIndex = 1;
43 | this.label1.Text = "Editing entities in Entity Generator is not currently supported. In a future ver" +
44 | "sion, you will be able to rename fields, set search orders, etc.";
45 | //
46 | // EditEntitiesView
47 | //
48 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
49 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
50 | this.Controls.Add(this.label1);
51 | this.Name = "EditEntitiesView";
52 | this.Controls.SetChildIndex(this.label1, 0);
53 | this.ResumeLayout(false);
54 |
55 | }
56 |
57 | #endregion
58 |
59 | private System.Windows.Forms.Label label1;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Tests/OpenNETCF.ORM.Validation/TestItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 | using System.Linq;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace OpenNETCF.ORM
8 | {
9 | public enum TestEnum
10 | {
11 | ValueA,
12 | ValueB,
13 | ValueC
14 | }
15 |
16 | [Entity(KeyScheme = KeyScheme.Identity)]
17 | public class TestItem : IEquatable
18 | {
19 | public TestItem()
20 | {
21 | }
22 |
23 | public TestItem(string name)
24 | {
25 | Name = name;
26 | }
27 |
28 | [Field(IsPrimaryKey = true)]
29 | public int ID { get; set; }
30 |
31 | [Field(SearchOrder = FieldSearchOrder.Ascending)]
32 | public string Name { get; set; }
33 |
34 | [Field]
35 | public Guid? UUID { get; set; }
36 |
37 | [Field]
38 | public int ITest { get; set; }
39 |
40 | [Field]
41 | public string Address { get; set; }
42 |
43 | [Field]
44 | public float FTest { get; set; }
45 |
46 | [Field]
47 | public double DBTest { get; set; }
48 |
49 | [Field(Scale = 2)]
50 | public decimal DETest { get; set; }
51 |
52 | [Field]
53 | public TimeSpan TS { get; set; }
54 |
55 | [Field(DefaultValue = "Default")]
56 | public string DefString { get; set; }
57 |
58 | [Field(DefaultType = DefaultType.CurrentDateTime)]
59 | public DateTime CreateDate { get; set; }
60 |
61 | [Field]
62 | public TestEnum EnumField { get; set; }
63 |
64 | [Field(DataType = DbType.String)]
65 | public TestEnum EnumFieldAsString { get; set; }
66 |
67 | public bool Equals(TestItem other)
68 | {
69 | return this.ID == other.ID;
70 | }
71 | }
72 |
73 | [Entity(KeyScheme = KeyScheme.Identity)]
74 | public class Author
75 | {
76 | [Field(IsPrimaryKey = true)]
77 | public int ID { get; set; }
78 |
79 | [Field]
80 | public string Name { get; set; }
81 |
82 | [Reference(typeof(Book), "AuthorID")]
83 | public Book[] Books { get; set; }
84 | }
85 |
86 | [Entity(KeyScheme = KeyScheme.Identity)]
87 | public class Book
88 | {
89 | [Field(IsPrimaryKey = true)]
90 | public int ID { get; set; }
91 |
92 | [Field]
93 | public int AuthorID { get; set; }
94 |
95 | [Field]
96 | public string Title { get; set; }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/SQL Compact/SqlCeDataStore_Delete.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data.SqlServerCe;
6 | using System.Data;
7 |
8 | namespace OpenNETCF.ORM
9 | {
10 | partial class SqlCeDataStore
11 | {
12 | protected override void Delete(Type t, object primaryKey)
13 | {
14 | string entityName = m_entities.GetNameForType(t);
15 |
16 | if (entityName == null)
17 | {
18 | throw new EntityNotFoundException(t);
19 | }
20 |
21 | if (Entities[entityName].Fields.KeyField == null)
22 | {
23 | throw new PrimaryKeyRequiredException("A primary key is required on an Entity in order to perform a Delete");
24 | }
25 |
26 | // handle cascade deletes
27 | foreach (var reference in Entities[entityName].References)
28 | {
29 | if (!reference.CascadeDelete) continue;
30 |
31 | Delete(reference.ReferenceEntityType, reference.ForeignReferenceField, primaryKey);
32 | }
33 |
34 | var connection = GetConnection(false);
35 | try
36 | {
37 | CheckOrdinals(entityName);
38 | CheckPrimaryKeyIndex(entityName);
39 |
40 | using (var command = new SqlCeCommand())
41 | {
42 | command.Connection = connection as SqlCeConnection;
43 | command.CommandText = entityName;
44 | command.CommandType = CommandType.TableDirect;
45 | command.IndexName = ((SqlEntityInfo)Entities[entityName]).PrimaryKeyIndexName;
46 | command.Transaction = CurrentTransaction as SqlCeTransaction;
47 |
48 | using (var results = command.ExecuteResultSet(ResultSetOptions.Scrollable | ResultSetOptions.Updatable))
49 | {
50 |
51 | // seek on the PK
52 | var found = results.Seek(DbSeekOptions.BeforeEqual, new object[] { primaryKey });
53 |
54 | if (!found)
55 | {
56 | throw new RecordNotFoundException("Cannot locate a record with the provided primary key. Unable to delete the item");
57 | }
58 |
59 | results.Read();
60 | results.Delete();
61 | }
62 | }
63 | }
64 | finally
65 | {
66 | DoneWithConnection(connection, false);
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------