From 7060dc80c707fc0441ff69fe4f899107cb3f6fc1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 27 Nov 2017 20:35:08 +0200 Subject: Split DAL to DAl.Local & DAL.Remote due to ambiguity of table names in EF. Implemented Unit testing for SQLite & SQL Server connections. --- Software/Visual_Studio/Tango.DAL.Local/App.config | 25 + .../Visual_Studio/Tango.DAL.Local/DB/ACTION.cs | 25 + .../Visual_Studio/Tango.DAL.Local/DB/ADDRESS.cs | 22 + .../DB/APPLICATION_FIRMWARE_VERSIONS.cs | 22 + .../Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs | 22 + .../Tango.DAL.Local/DB/APPLICATION_VERSION.cs | 22 + .../Tango.DAL.Local/DB/CONFIGURATION.cs | 22 + .../DB/CONFIGURATIONS_DISPENSERS.cs | 22 + .../Visual_Studio/Tango.DAL.Local/DB/CONTACT.cs | 22 + .../Visual_Studio/Tango.DAL.Local/DB/DISPENSER.cs | 22 + .../DB/EMBEDDED_FIRMWARE_VERSIONS.cs | 22 + .../DB/EMBEDDED_SOFTWARE_VERSIONS.cs | 22 + Software/Visual_Studio/Tango.DAL.Local/DB/EVENT.cs | 22 + .../Tango.DAL.Local/DB/EVENTS_ACTIONS.cs | 22 + .../Tango.DAL.Local/DB/FIBER_SHAPES.cs | 22 + .../Tango.DAL.Local/DB/FIBER_SYNTHESIS.cs | 22 + .../Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs | 22 + .../DB/LINEAR_MASS_DENSITY_UNITS.cs | 22 + .../Visual_Studio/Tango.DAL.Local/DB/LIQUID.cs | 22 + .../Tango.DAL.Local/DB/LIQUIDS_RML.cs | 22 + .../Tango.DAL.Local/DB/LIQUID_TYPES.cs | 22 + .../Tango.DAL.Local/DB/LocalADO.Context.cs | 63 + .../Tango.DAL.Local/DB/LocalADO.Context.tt | 636 +++++ .../Tango.DAL.Local/DB/LocalADO.Designer.cs | 10 + .../Visual_Studio/Tango.DAL.Local/DB/LocalADO.cs | 9 + .../Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx | 1074 ++++++++ .../Tango.DAL.Local/DB/LocalADO.edmx.diagram | 45 + .../Visual_Studio/Tango.DAL.Local/DB/LocalADO.tt | 733 ++++++ .../Visual_Studio/Tango.DAL.Local/DB/MACHINE.cs | 22 + .../Tango.DAL.Local/DB/MACHINES_EVENTS.cs | 22 + .../Tango.DAL.Local/DB/MACHINE_VERSIONS.cs | 22 + .../Tango.DAL.Local/DB/MEDIA_COLORS.cs | 22 + .../Tango.DAL.Local/DB/MEDIA_CONDITIONS.cs | 22 + .../Tango.DAL.Local/DB/MEDIA_MATERIALS.cs | 22 + .../Tango.DAL.Local/DB/MEDIA_PURPOSES.cs | 22 + .../Tango.DAL.Local/DB/ORGANIZATION.cs | 22 + .../Visual_Studio/Tango.DAL.Local/DB/PERMISSION.cs | 22 + Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs | 22 + Software/Visual_Studio/Tango.DAL.Local/DB/ROLE.cs | 22 + .../Tango.DAL.Local/DB/ROLES_PERMISSIONS.cs | 22 + Software/Visual_Studio/Tango.DAL.Local/DB/USER.cs | 22 + .../Tango.DAL.Local/DB/USERS_ROLES.cs | 22 + .../Tango.DAL.Local/Partials/LocalDB.cs | 22 + .../Tango.DAL.Local/Properties/AssemblyInfo.cs | 6 + .../Tango.DAL.Local/Tango.DAL.Local.csproj | 222 ++ .../Visual_Studio/Tango.DAL.Local/packages.config | 8 + Software/Visual_Studio/Tango.DAL.Remote/App.config | 25 + .../Visual_Studio/Tango.DAL.Remote/DB/ACTION.cs | 34 + .../Visual_Studio/Tango.DAL.Remote/DB/ADDRESS.cs | 41 + .../DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs | 31 + .../DB/APPLICATION_FIRMWARE_VERSIONS.cs | 31 + .../Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs | 31 + .../Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs | 31 + .../Tango.DAL.Remote/DB/CONFIGURATION.cs | 51 + .../DB/CONFIGURATIONS_DISPENSERS.cs | 29 + .../Visual_Studio/Tango.DAL.Remote/DB/CONTACT.cs | 40 + .../Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs | 31 + .../DB/EMBEDDED_FIRMWARE_VERSIONS.cs | 31 + .../DB/EMBEDDED_SOFTWARE_VERSIONS.cs | 31 + .../Visual_Studio/Tango.DAL.Remote/DB/EVENT.cs | 37 + .../Tango.DAL.Remote/DB/EVENTS_ACTIONS.cs | 27 + .../Tango.DAL.Remote/DB/FIBER_SHAPES.cs | 33 + .../Tango.DAL.Remote/DB/FIBER_SYNTHESIS.cs | 33 + .../Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs | 31 + .../DB/LINEAR_MASS_DENSITY_UNITS.cs | 33 + .../Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs | 38 + .../Tango.DAL.Remote/DB/LIQUIDS_RML.cs | 27 + .../Tango.DAL.Remote/DB/LIQUID_TYPES.cs | 34 + .../Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs | 40 + .../Tango.DAL.Remote/DB/MACHINES_EVENTS.cs | 31 + .../Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs | 34 + .../Tango.DAL.Remote/DB/MEDIA_COLORS.cs | 32 + .../Tango.DAL.Remote/DB/MEDIA_CONDITIONS.cs | 33 + .../Tango.DAL.Remote/DB/MEDIA_MATERIALS.cs | 33 + .../Tango.DAL.Remote/DB/MEDIA_PURPOSES.cs | 33 + .../Tango.DAL.Remote/DB/ORGANIZATION.cs | 39 + .../Tango.DAL.Remote/DB/PERMISSION.cs | 33 + Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 56 + Software/Visual_Studio/Tango.DAL.Remote/DB/ROLE.cs | 36 + .../Tango.DAL.Remote/DB/ROLES_PERMISSIONS.cs | 27 + .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 64 + .../Tango.DAL.Remote/DB/RemoteADO.Context.tt | 636 +++++ .../Tango.DAL.Remote/DB/RemoteADO.Designer.cs | 10 + .../Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.cs | 9 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 2685 ++++++++++++++++++++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 84 + .../Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.tt | 733 ++++++ Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs | 42 + .../Tango.DAL.Remote/DB/USERS_ROLES.cs | 27 + .../Tango.DAL.Remote/Partials/RemoteDB.cs | 31 + .../Tango.DAL.Remote/Properties/AssemblyInfo.cs | 6 + .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 225 ++ .../Visual_Studio/Tango.DAL.Remote/packages.config | 8 + Software/Visual_Studio/Tango.DAL/App.config | 29 - Software/Visual_Studio/Tango.DAL/Class1.cs | 16 - Software/Visual_Studio/Tango.DAL/Local/ACTION.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/ADDRESS.cs | 22 - .../Local/APPLICATION_FIRMWARE_VERSIONS.cs | 22 - .../Tango.DAL/Local/APPLICATION_OS_VERSIONS.cs | 22 - .../Tango.DAL/Local/APPLICATION_VERSION.cs | 22 - .../Visual_Studio/Tango.DAL/Local/CONFIGURATION.cs | 22 - .../Tango.DAL/Local/CONFIGURATIONS_DISPENSERS.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/CONTACT.cs | 22 - .../Visual_Studio/Tango.DAL/Local/DISPENSER.cs | 22 - .../Tango.DAL/Local/EMBEDDED_FIRMWARE_VERSIONS.cs | 22 - .../Tango.DAL/Local/EMBEDDED_SOFTWARE_VERSIONS.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/EVENT.cs | 22 - .../Tango.DAL/Local/EVENTS_ACTIONS.cs | 22 - .../Visual_Studio/Tango.DAL/Local/FIBER_SHAPES.cs | 22 - .../Tango.DAL/Local/FIBER_SYNTHESIS.cs | 22 - .../Tango.DAL/Local/HARDWARE_VERSIONS.cs | 22 - .../Tango.DAL/Local/LINEAR_MASS_DENSITY_UNITS.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/LIQUID.cs | 22 - .../Visual_Studio/Tango.DAL/Local/LIQUIDS_RML.cs | 22 - .../Visual_Studio/Tango.DAL/Local/LIQUID_TYPES.cs | 22 - .../Tango.DAL/Local/LocalADO.Context.cs | 63 - .../Tango.DAL/Local/LocalADO.Context.tt | 636 ----- .../Tango.DAL/Local/LocalADO.Designer.cs | 10 - Software/Visual_Studio/Tango.DAL/Local/LocalADO.cs | 9 - .../Visual_Studio/Tango.DAL/Local/LocalADO.edmx | 1066 -------- .../Tango.DAL/Local/LocalADO.edmx.diagram | 45 - Software/Visual_Studio/Tango.DAL/Local/LocalADO.tt | 733 ------ Software/Visual_Studio/Tango.DAL/Local/MACHINE.cs | 22 - .../Tango.DAL/Local/MACHINES_EVENTS.cs | 22 - .../Tango.DAL/Local/MACHINE_VERSIONS.cs | 22 - .../Visual_Studio/Tango.DAL/Local/MEDIA_COLORS.cs | 22 - .../Tango.DAL/Local/MEDIA_CONDITIONS.cs | 22 - .../Tango.DAL/Local/MEDIA_MATERIALS.cs | 22 - .../Tango.DAL/Local/MEDIA_PURPOSES.cs | 22 - .../Visual_Studio/Tango.DAL/Local/ORGANIZATION.cs | 22 - .../Visual_Studio/Tango.DAL/Local/PERMISSION.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/RML.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/ROLE.cs | 22 - .../Tango.DAL/Local/ROLES_PERMISSIONS.cs | 22 - Software/Visual_Studio/Tango.DAL/Local/USER.cs | 22 - .../Visual_Studio/Tango.DAL/Local/USERS_ROLES.cs | 22 - .../Visual_Studio/Tango.DAL/Partials/LocalDB.cs | 23 - .../Visual_Studio/Tango.DAL/Partials/ServerDB.cs | 23 - .../Tango.DAL/Properties/AssemblyInfo.cs | 6 - Software/Visual_Studio/Tango.DAL/Server/ACTION.cs | 34 - Software/Visual_Studio/Tango.DAL/Server/ADDRESS.cs | 41 - .../Server/APPLICATION_DISPLAY_PANEL_VERSIONS.cs | 31 - .../Server/APPLICATION_FIRMWARE_VERSIONS.cs | 31 - .../Tango.DAL/Server/APPLICATION_OS_VERSIONS.cs | 31 - .../Tango.DAL/Server/APPLICATION_VERSIONS.cs | 31 - .../Tango.DAL/Server/CONFIGURATION.cs | 51 - .../Tango.DAL/Server/CONFIGURATIONS_DISPENSERS.cs | 29 - Software/Visual_Studio/Tango.DAL/Server/CONTACT.cs | 40 - .../Visual_Studio/Tango.DAL/Server/DISPENSER.cs | 31 - .../Tango.DAL/Server/EMBEDDED_FIRMWARE_VERSIONS.cs | 31 - .../Tango.DAL/Server/EMBEDDED_SOFTWARE_VERSIONS.cs | 31 - Software/Visual_Studio/Tango.DAL/Server/EVENT.cs | 37 - .../Tango.DAL/Server/EVENTS_ACTIONS.cs | 27 - .../Visual_Studio/Tango.DAL/Server/FIBER_SHAPES.cs | 33 - .../Tango.DAL/Server/FIBER_SYNTHESIS.cs | 33 - .../Tango.DAL/Server/HARDWARE_VERSIONS.cs | 31 - .../Tango.DAL/Server/LINEAR_MASS_DENSITY_UNITS.cs | 33 - Software/Visual_Studio/Tango.DAL/Server/LIQUID.cs | 38 - .../Visual_Studio/Tango.DAL/Server/LIQUIDS_RML.cs | 27 - .../Visual_Studio/Tango.DAL/Server/LIQUID_TYPES.cs | 34 - Software/Visual_Studio/Tango.DAL/Server/MACHINE.cs | 40 - .../Tango.DAL/Server/MACHINES_EVENTS.cs | 31 - .../Tango.DAL/Server/MACHINE_VERSIONS.cs | 34 - .../Visual_Studio/Tango.DAL/Server/MEDIA_COLORS.cs | 32 - .../Tango.DAL/Server/MEDIA_CONDITIONS.cs | 33 - .../Tango.DAL/Server/MEDIA_MATERIALS.cs | 33 - .../Tango.DAL/Server/MEDIA_PURPOSES.cs | 33 - .../Visual_Studio/Tango.DAL/Server/ORGANIZATION.cs | 39 - .../Visual_Studio/Tango.DAL/Server/PERMISSION.cs | 33 - Software/Visual_Studio/Tango.DAL/Server/RML.cs | 56 - Software/Visual_Studio/Tango.DAL/Server/ROLE.cs | 36 - .../Tango.DAL/Server/ROLES_PERMISSIONS.cs | 27 - .../Tango.DAL/Server/ServerADO.Context.cs | 64 - .../Tango.DAL/Server/ServerADO.Context.tt | 636 ----- .../Tango.DAL/Server/ServerADO.Designer.cs | 10 - .../Visual_Studio/Tango.DAL/Server/ServerADO.cs | 9 - .../Visual_Studio/Tango.DAL/Server/ServerADO.edmx | 2685 -------------------- .../Tango.DAL/Server/ServerADO.edmx.diagram | 84 - .../Visual_Studio/Tango.DAL/Server/ServerADO.tt | 733 ------ Software/Visual_Studio/Tango.DAL/Server/USER.cs | 42 - .../Visual_Studio/Tango.DAL/Server/USERS_ROLES.cs | 27 - Software/Visual_Studio/Tango.DAL/Tango.DAL.csproj | 363 --- Software/Visual_Studio/Tango.DAL/packages.config | 8 - .../Visual_Studio/Tango.UnitTesting/App.config | 20 + .../Visual_Studio/Tango.UnitTesting/DAL_TST.cs | 64 + Software/Visual_Studio/Tango.UnitTesting/Helper.cs | 9 + .../Tango.UnitTesting/Tango.UnitTesting.csproj | 30 + .../Tango.UnitTesting/packages.config | 5 + Software/Visual_Studio/Tango.sln | 40 +- 189 files changed, 9476 insertions(+), 9213 deletions(-) create mode 100644 Software/Visual_Studio/Tango.DAL.Local/App.config create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/ACTION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/ADDRESS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATIONS_DISPENSERS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/CONTACT.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/EVENT.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/EVENTS_ACTIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SHAPES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESIS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LINEAR_MASS_DENSITY_UNITS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LIQUIDS_RML.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.tt create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Designer.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.tt create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MACHINES_EVENTS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_COLORS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_CONDITIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_MATERIALS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_PURPOSES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/ORGANIZATION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/PERMISSION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/ROLE.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/ROLES_PERMISSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/USER.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/USERS_ROLES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj create mode 100644 Software/Visual_Studio/Tango.DAL.Local/packages.config create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/App.config create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/ACTION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/ADDRESS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATIONS_DISPENSERS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/CONTACT.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/EVENT.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/EVENTS_ACTIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SHAPES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHESIS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/LINEAR_MASS_DENSITY_UNITS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUIDS_RML.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINES_EVENTS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_COLORS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_CONDITIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_MATERIALS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_PURPOSES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/ORGANIZATION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/PERMISSION.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/ROLE.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/ROLES_PERMISSIONS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.tt create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.tt create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/USERS_ROLES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/packages.config delete mode 100644 Software/Visual_Studio/Tango.DAL/App.config delete mode 100644 Software/Visual_Studio/Tango.DAL/Class1.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/ACTION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/ADDRESS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/APPLICATION_FIRMWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/APPLICATION_OS_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/APPLICATION_VERSION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/CONFIGURATION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/CONFIGURATIONS_DISPENSERS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/CONTACT.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/DISPENSER.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_FIRMWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_SOFTWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/EVENT.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/EVENTS_ACTIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/FIBER_SHAPES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/FIBER_SYNTHESIS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/HARDWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LINEAR_MASS_DENSITY_UNITS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LIQUID.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LIQUIDS_RML.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LIQUID_TYPES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.tt delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.Designer.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx.diagram delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/LocalADO.tt delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MACHINE.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MACHINES_EVENTS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MACHINE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MEDIA_COLORS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MEDIA_CONDITIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MEDIA_MATERIALS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/MEDIA_PURPOSES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/ORGANIZATION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/PERMISSION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/RML.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/ROLE.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/ROLES_PERMISSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/USER.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Local/USERS_ROLES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Partials/LocalDB.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Partials/ServerDB.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Properties/AssemblyInfo.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ACTION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ADDRESS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/APPLICATION_DISPLAY_PANEL_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/APPLICATION_FIRMWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/APPLICATION_OS_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/APPLICATION_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/CONFIGURATION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/CONFIGURATIONS_DISPENSERS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/CONTACT.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/DISPENSER.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_FIRMWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_SOFTWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/EVENT.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/EVENTS_ACTIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/FIBER_SHAPES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/FIBER_SYNTHESIS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/HARDWARE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/LINEAR_MASS_DENSITY_UNITS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/LIQUID.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/LIQUIDS_RML.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/LIQUID_TYPES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MACHINE.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MACHINES_EVENTS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MACHINE_VERSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MEDIA_COLORS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MEDIA_CONDITIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MEDIA_MATERIALS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/MEDIA_PURPOSES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ORGANIZATION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/PERMISSION.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/RML.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ROLE.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ROLES_PERMISSIONS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.tt delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.Designer.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx.diagram delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/ServerADO.tt delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/USER.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Server/USERS_ROLES.cs delete mode 100644 Software/Visual_Studio/Tango.DAL/Tango.DAL.csproj delete mode 100644 Software/Visual_Studio/Tango.DAL/packages.config create mode 100644 Software/Visual_Studio/Tango.UnitTesting/App.config create mode 100644 Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Tango.DAL.Local/App.config b/Software/Visual_Studio/Tango.DAL.Local/App.config new file mode 100644 index 000000000..8c1be0e4c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/App.config @@ -0,0 +1,25 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/ACTION.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/ACTION.cs new file mode 100644 index 000000000..6bc2a9274 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/ACTION.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class ACTION + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public long CODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/ADDRESS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/ADDRESS.cs new file mode 100644 index 000000000..808244106 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/ADDRESS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class ADDRESS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs new file mode 100644 index 000000000..3cf9cd3ce --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_FIRMWARE_VERSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs new file mode 100644 index 000000000..a3d4afab8 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_OS_VERSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSION.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSION.cs new file mode 100644 index 000000000..1e745d1ac --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSION.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_VERSION + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATION.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATION.cs new file mode 100644 index 000000000..7acc1ee6b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATION.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class CONFIGURATION + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATIONS_DISPENSERS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATIONS_DISPENSERS.cs new file mode 100644 index 000000000..3a289e206 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATIONS_DISPENSERS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class CONFIGURATIONS_DISPENSERS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/CONTACT.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/CONTACT.cs new file mode 100644 index 000000000..cf792d22d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/CONTACT.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class CONTACT + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER.cs new file mode 100644 index 000000000..211d141cb --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class DISPENSER + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs new file mode 100644 index 000000000..d44343495 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class EMBEDDED_FIRMWARE_VERSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs new file mode 100644 index 000000000..a0b0a7b22 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class EMBEDDED_SOFTWARE_VERSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT.cs new file mode 100644 index 000000000..f9c8837ac --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class EVENT + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EVENTS_ACTIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EVENTS_ACTIONS.cs new file mode 100644 index 000000000..84bcb5f03 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EVENTS_ACTIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class EVENTS_ACTIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SHAPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SHAPES.cs new file mode 100644 index 000000000..b90db2f5d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SHAPES.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class FIBER_SHAPES + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESIS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESIS.cs new file mode 100644 index 000000000..07f0375b6 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESIS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class FIBER_SYNTHESIS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs new file mode 100644 index 000000000..0ceb68f7c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class HARDWARE_VERSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LINEAR_MASS_DENSITY_UNITS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LINEAR_MASS_DENSITY_UNITS.cs new file mode 100644 index 000000000..84cd28833 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LINEAR_MASS_DENSITY_UNITS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class LINEAR_MASS_DENSITY_UNITS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID.cs new file mode 100644 index 000000000..30028c84c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class LIQUID + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUIDS_RML.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUIDS_RML.cs new file mode 100644 index 000000000..07f8ed49c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUIDS_RML.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class LIQUIDS_RML + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs new file mode 100644 index 000000000..1a5119212 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class LIQUID_TYPES + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs new file mode 100644 index 000000000..47b8dd69c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class LocalDB : DbContext + { + public LocalDB() + : base("name=LocalDB") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public virtual DbSet ACTIONS { get; set; } + public virtual DbSet
ADDRESSES { get; set; } + public virtual DbSet APPLICATION_FIRMWARE_VERSIONS { get; set; } + public virtual DbSet APPLICATION_OS_VERSIONS { get; set; } + public virtual DbSet APPLICATION_VERSION { get; set; } + public virtual DbSet CONFIGURATIONS { get; set; } + public virtual DbSet CONFIGURATIONS_DISPENSERS { get; set; } + public virtual DbSet CONTACTS { get; set; } + public virtual DbSet DISPENSERS { get; set; } + public virtual DbSet EMBEDDED_FIRMWARE_VERSIONS { get; set; } + public virtual DbSet EMBEDDED_SOFTWARE_VERSIONS { get; set; } + public virtual DbSet EVENTS { get; set; } + public virtual DbSet EVENTS_ACTIONS { get; set; } + public virtual DbSet FIBER_SHAPES { get; set; } + public virtual DbSet FIBER_SYNTHESIS { get; set; } + public virtual DbSet HARDWARE_VERSIONS { get; set; } + public virtual DbSet LINEAR_MASS_DENSITY_UNITS { get; set; } + public virtual DbSet LIQUID_TYPES { get; set; } + public virtual DbSet LIQUIDS { get; set; } + public virtual DbSet LIQUIDS_RML { get; set; } + public virtual DbSet MACHINE_VERSIONS { get; set; } + public virtual DbSet MACHINES { get; set; } + public virtual DbSet MACHINES_EVENTS { get; set; } + public virtual DbSet MEDIA_COLORS { get; set; } + public virtual DbSet MEDIA_CONDITIONS { get; set; } + public virtual DbSet MEDIA_MATERIALS { get; set; } + public virtual DbSet MEDIA_PURPOSES { get; set; } + public virtual DbSet ORGANIZATIONS { get; set; } + public virtual DbSet PERMISSIONS { get; set; } + public virtual DbSet RMLs { get; set; } + public virtual DbSet ROLES { get; set; } + public virtual DbSet ROLES_PERMISSIONS { get; set; } + public virtual DbSet USERS { get; set; } + public virtual DbSet USERS_ROLES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.tt b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.tt new file mode 100644 index 000000000..058773afd --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.tt @@ -0,0 +1,636 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"LocalADO.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); +var itemCollection = loader.CreateEdmItemCollection(inputFile); +var modelNamespace = loader.GetModelNamespace(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +var container = itemCollection.OfType().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +var codeNamespace = code.VsNamespaceSuggestion(); +if (!String.IsNullOrEmpty(codeNamespace)) +{ +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<# + PushIndent(" "); +} + +#> +using System; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Entity.Core.Objects; +using System.Linq; +<# +} +#> + +<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext +{ + public <#=code.Escape(container)#>() + : base("name=<#=container.Name#>") + { +<# +if (!loader.IsLazyLoadingEnabled(container)) +{ +#> + this.Configuration.LazyLoadingEnabled = false; +<# +} + +foreach (var entitySet in container.BaseEntitySets.OfType()) +{ + // Note: the DbSet members are defined below such that the getter and + // setter always have the same accessibility as the DbSet definition + if (Accessibility.ForReadOnlyProperty(entitySet) != "public") + { +#> + <#=codeStringGenerator.DbSetInitializer(entitySet)#> +<# + } +} +#> + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=codeStringGenerator.DbSet(entitySet)#> +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); + } +#> +} +<# + +if (!String.IsNullOrEmpty(codeNamespace)) +{ + PopIndent(); +#> +} +<# +} +#> +<#+ + +private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) +{ + if (typeMapper.IsComposable(edmFunction)) + { +#> + + [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] + <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> + } +<#+ + } + else + { +#> + + <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> + } +<#+ + if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); + } + } +} + +public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) +{ +#> + var <#=name#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ +} + +public const string TemplateId = "CSharp_DbContext_Context_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string DbSetInitializer(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} = Set<{1}>();", + _code.Escape(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Designer.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Designer.cs new file mode 100644 index 000000000..81ec10f3f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Designer.cs @@ -0,0 +1,10 @@ +// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL.Local\DB\LocalADO.edmx'. +// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer +// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model +// is open in the designer. + +// If no context and entity classes have been generated, it may be because you created an empty model but +// have not yet chosen which version of Entity Framework to use. To generate a context class and entity +// classes for your model, open the model in the designer, right-click on the designer surface, and +// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation +// Item...'. \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.cs new file mode 100644 index 000000000..7cc066228 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx new file mode 100644 index 000000000..57e44c3ed --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx @@ -0,0 +1,1074 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram new file mode 100644 index 000000000..d0490a23a --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.tt b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.tt new file mode 100644 index 000000000..4acc3fed3 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.tt @@ -0,0 +1,733 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"LocalADO.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var fileManager = EntityFrameworkTemplateFileManager.Create(this); +var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) +{ + return string.Empty; +} + +WriteHeader(codeStringGenerator, fileManager); + +foreach (var entity in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false)#> +<#=codeStringGenerator.EntityClassOpening(entity)#> +{ +<# + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); + var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); + var complexProperties = typeMapper.GetComplexProperties(entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(entity); + if (simpleProperties.Any()) + { + foreach (var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(complexProperty)#> +<# + } + } + + var navigationProperties = typeMapper.GetNavigationProperties(entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] +<# + } +#> + <#=codeStringGenerator.NavigationProperty(navigationProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var complex in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = typeMapper.GetComplexProperties(complex); + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(complex); + if (simpleProperties.Any()) + { + foreach(var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(enumType.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<# + if (typeMapper.EnumIsFlags(enumType)) + { +#> +[Flags] +<# + } +#> +<#=codeStringGenerator.EnumOpening(enumType)#> +{ +<# + var foundOne = false; + + foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) + { + foundOne = true; +#> + <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, +<# + } + + if (foundOne) + { + this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); + } +#> +} +<# + EndNamespace(code); +} + +fileManager.Process(); + +#> +<#+ + +public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ +<#=codeStringGenerator.UsingDirectives(inHeader: true)#> +<#+ + fileManager.EndBlock(); +} + +public void BeginNamespace(CodeGenerationTools code) +{ + var codeNamespace = code.VsNamespaceSuggestion(); + if (!String.IsNullOrEmpty(codeNamespace)) + { +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<#+ + PushIndent(" "); + } +} + +public void EndNamespace(CodeGenerationTools code) +{ + if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) + { + PopIndent(); +#> +} +<#+ + } +} + +public const string TemplateId = "CSharp_DbContext_Types_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE.cs new file mode 100644 index 000000000..cfffb4426 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MACHINE + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINES_EVENTS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINES_EVENTS.cs new file mode 100644 index 000000000..a3e6ca953 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINES_EVENTS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MACHINES_EVENTS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs new file mode 100644 index 000000000..e1a5d108c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MACHINE_VERSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_COLORS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_COLORS.cs new file mode 100644 index 000000000..c8ed1229f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_COLORS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_COLORS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_CONDITIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_CONDITIONS.cs new file mode 100644 index 000000000..43a07a2a8 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_CONDITIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_CONDITIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_MATERIALS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_MATERIALS.cs new file mode 100644 index 000000000..d2726980e --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_MATERIALS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_MATERIALS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_PURPOSES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_PURPOSES.cs new file mode 100644 index 000000000..f335c2949 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MEDIA_PURPOSES.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_PURPOSES + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/ORGANIZATION.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/ORGANIZATION.cs new file mode 100644 index 000000000..b0e471487 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/ORGANIZATION.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class ORGANIZATION + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/PERMISSION.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/PERMISSION.cs new file mode 100644 index 000000000..368dcf103 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/PERMISSION.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class PERMISSION + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs new file mode 100644 index 000000000..44730636f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class RML + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/ROLE.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/ROLE.cs new file mode 100644 index 000000000..19841df9e --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/ROLE.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class ROLE + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/ROLES_PERMISSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/ROLES_PERMISSIONS.cs new file mode 100644 index 000000000..76ac2e872 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/ROLES_PERMISSIONS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class ROLES_PERMISSIONS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/USER.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/USER.cs new file mode 100644 index 000000000..b705398f7 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/USER.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class USER + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/USERS_ROLES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/USERS_ROLES.cs new file mode 100644 index 000000000..b0d2aa5e5 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/USERS_ROLES.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class USERS_ROLES + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs b/Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs new file mode 100644 index 000000000..2ad765a2b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DAL.Local.DB +{ + public partial class LocalDB : DbContext + { + public LocalDB(String filePath) : base(ComposeConnectionString(filePath)) + { + + } + + private static String ComposeConnectionString(String filePath) + { + return String.Format("metadata=res://*/DB.LocalADO.csdl|res://*/DB.LocalADO.ssdl|res://*/DB.LocalADO.msl;provider=System.Data.SQLite.EF6;provider connection string=\"data source={0}\"", filePath); + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DAL.Local/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5d006eb2a --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Local Data Access Layer")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj new file mode 100644 index 000000000..6ea3badfc --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj @@ -0,0 +1,222 @@ + + + + + Debug + AnyCPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12} + Library + Properties + Tango.DAL.Local + Tango.DAL.Local + v4.6 + 512 + + + + + true + full + false + ..\Build\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + + + + + + ..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net46\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.EF6.1.0.106.0\lib\net46\System.Data.SQLite.EF6.dll + True + + + ..\packages\System.Data.SQLite.Linq.1.0.106.0\lib\net46\System.Data.SQLite.Linq.dll + True + + + + + + + + + + + + + GlobalVersionInfo.cs + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + True + True + LocalADO.Context.tt + + + True + True + LocalADO.tt + + + True + True + LocalADO.edmx + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + LocalADO.tt + + + + + + + + EntityModelCodeGenerator + LocalADO.Designer.cs + + + LocalADO.edmx + + + + + + + + + TextTemplatingFileGenerator + LocalADO.edmx + LocalADO.Context.cs + + + TextTemplatingFileGenerator + LocalADO.edmx + LocalADO.cs + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/packages.config b/Software/Visual_Studio/Tango.DAL.Local/packages.config new file mode 100644 index 000000000..bee3cc627 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/App.config b/Software/Visual_Studio/Tango.DAL.Remote/App.config new file mode 100644 index 000000000..78a5cb60c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/App.config @@ -0,0 +1,25 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/ACTION.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/ACTION.cs new file mode 100644 index 000000000..0d6d93cbd --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/ACTION.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class ACTION + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ACTION() + { + this.EVENTS_ACTIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection EVENTS_ACTIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/ADDRESS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/ADDRESS.cs new file mode 100644 index 000000000..3cbe7d0d6 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/ADDRESS.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class ADDRESS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ADDRESS() + { + this.ORGANIZATIONS = new HashSet(); + this.USERS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string ADDRESS1 { get; set; } + public string LOCALITY { get; set; } + public string COUNTRY { get; set; } + public string CITY { get; set; } + public string STATE { get; set; } + public string COUNTRY_CODE { get; set; } + public string POSTAL_CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ORGANIZATIONS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection USERS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs new file mode 100644 index 000000000..efba337da --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_DISPLAY_PANEL_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public APPLICATION_DISPLAY_PANEL_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs new file mode 100644 index 000000000..a51070adc --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_FIRMWARE_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public APPLICATION_FIRMWARE_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs new file mode 100644 index 000000000..2db9b1ceb --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_OS_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public APPLICATION_OS_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs new file mode 100644 index 000000000..307d86358 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class APPLICATION_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public APPLICATION_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs new file mode 100644 index 000000000..1d80a58a8 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class CONFIGURATION + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public CONFIGURATION() + { + this.CONFIGURATIONS_DISPENSERS = new HashSet(); + this.MACHINE_VERSIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public System.DateTime CREATION_DATE { get; set; } + public int MACHINE_ID { get; set; } + public int APPLICATION_VERSION_ID { get; set; } + public int APPLICATION_OS_VERSION_ID { get; set; } + public int APPLICATION_FIRMWARE_VERSION_ID { get; set; } + public int APPLICATION_DISPLAY_PANEL_VERSION_ID { get; set; } + public int EMBEDDED_FIRMWARE_VERSION_ID { get; set; } + public int EMBEDDED_SOFTWARE_VERSION_ID { get; set; } + public int HARDWARE_VERSION_ID { get; set; } + + public virtual APPLICATION_DISPLAY_PANEL_VERSIONS APPLICATION_DISPLAY_PANEL_VERSIONS { get; set; } + public virtual APPLICATION_FIRMWARE_VERSIONS APPLICATION_FIRMWARE_VERSIONS { get; set; } + public virtual APPLICATION_OS_VERSIONS APPLICATION_OS_VERSIONS { get; set; } + public virtual APPLICATION_VERSIONS APPLICATION_VERSIONS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS_DISPENSERS { get; set; } + public virtual EMBEDDED_FIRMWARE_VERSIONS EMBEDDED_FIRMWARE_VERSIONS { get; set; } + public virtual EMBEDDED_SOFTWARE_VERSIONS EMBEDDED_SOFTWARE_VERSIONS { get; set; } + public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } + public virtual MACHINE MACHINE { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MACHINE_VERSIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATIONS_DISPENSERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATIONS_DISPENSERS.cs new file mode 100644 index 000000000..314130c6a --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATIONS_DISPENSERS.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class CONFIGURATIONS_DISPENSERS + { + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int CONFIGURATION_ID { get; set; } + public int DISPENSER_ID { get; set; } + public int LIQUID_ID { get; set; } + + public virtual CONFIGURATION CONFIGURATION { get; set; } + public virtual DISPENSER DISPENSER { get; set; } + public virtual LIQUID LIQUID { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONTACT.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONTACT.cs new file mode 100644 index 000000000..776de0b9d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONTACT.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class CONTACT + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public CONTACT() + { + this.ORGANIZATIONS = new HashSet(); + this.USERS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string FIRST_NAME { get; set; } + public string LAST_NAME { get; set; } + public string FULL_NAME { get; set; } + public string EMAIL { get; set; } + public string PHONE_NUMBER { get; set; } + public string FAX { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ORGANIZATIONS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection USERS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs new file mode 100644 index 000000000..0d85157cf --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class DISPENSER + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public DISPENSER() + { + this.CONFIGURATIONS_DISPENSERS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS_DISPENSERS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs new file mode 100644 index 000000000..57c0ff17d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class EMBEDDED_FIRMWARE_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public EMBEDDED_FIRMWARE_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs new file mode 100644 index 000000000..8729b1f14 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class EMBEDDED_SOFTWARE_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public EMBEDDED_SOFTWARE_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/EVENT.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/EVENT.cs new file mode 100644 index 000000000..abfb0420f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/EVENT.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class EVENT + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public EVENT() + { + this.EVENTS_ACTIONS = new HashSet(); + this.MACHINES_EVENTS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection EVENTS_ACTIONS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MACHINES_EVENTS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/EVENTS_ACTIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/EVENTS_ACTIONS.cs new file mode 100644 index 000000000..58797a747 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/EVENTS_ACTIONS.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class EVENTS_ACTIONS + { + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int EVENT_ID { get; set; } + public int ACTION_ID { get; set; } + + public virtual ACTION ACTION { get; set; } + public virtual EVENT EVENT { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SHAPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SHAPES.cs new file mode 100644 index 000000000..bc97ccc51 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SHAPES.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class FIBER_SHAPES + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public FIBER_SHAPES() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHESIS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHESIS.cs new file mode 100644 index 000000000..4182e0bc2 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHESIS.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class FIBER_SYNTHESIS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public FIBER_SYNTHESIS() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs new file mode 100644 index 000000000..da7891f4c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class HARDWARE_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HARDWARE_VERSIONS() + { + this.CONFIGURATIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/LINEAR_MASS_DENSITY_UNITS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/LINEAR_MASS_DENSITY_UNITS.cs new file mode 100644 index 000000000..a0af02a1d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/LINEAR_MASS_DENSITY_UNITS.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class LINEAR_MASS_DENSITY_UNITS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public LINEAR_MASS_DENSITY_UNITS() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs new file mode 100644 index 000000000..68bfed902 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class LIQUID + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public LIQUID() + { + this.CONFIGURATIONS_DISPENSERS = new HashSet(); + this.LIQUIDS_RML = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public double VERSION { get; set; } + public int LIQUID_TYPE_ID { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS_DISPENSERS { get; set; } + public virtual LIQUID_TYPES LIQUID_TYPES { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection LIQUIDS_RML { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUIDS_RML.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUIDS_RML.cs new file mode 100644 index 000000000..3dff203c6 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUIDS_RML.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class LIQUIDS_RML + { + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int LIQUID_ID { get; set; } + public int RML_ID { get; set; } + + public virtual LIQUID LIQUID { get; set; } + public virtual RML RML { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES.cs new file mode 100644 index 000000000..f666b3517 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class LIQUID_TYPES + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public LIQUID_TYPES() + { + this.LIQUIDS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection LIQUIDS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs new file mode 100644 index 000000000..5a319a9fd --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MACHINE + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MACHINE() + { + this.CONFIGURATIONS = new HashSet(); + this.MACHINES_EVENTS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string SERIAL_NUMBER { get; set; } + public System.DateTime PRODUCTION_DATE { get; set; } + public int ORGANIZATION_ID { get; set; } + public int MACHINE_VERSION_ID { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CONFIGURATIONS { get; set; } + public virtual MACHINE_VERSIONS MACHINE_VERSIONS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MACHINES_EVENTS { get; set; } + public virtual ORGANIZATION ORGANIZATION { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINES_EVENTS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINES_EVENTS.cs new file mode 100644 index 000000000..94084ead1 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINES_EVENTS.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MACHINES_EVENTS + { + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int MACHINE_ID { get; set; } + public int EVENT_ID { get; set; } + public int USER_ID { get; set; } + public System.DateTime DATE_TIME { get; set; } + public string DESCRIPTION { get; set; } + + public virtual EVENT EVENT { get; set; } + public virtual MACHINE MACHINE { get; set; } + public virtual USER USER { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs new file mode 100644 index 000000000..581cb39a2 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MACHINE_VERSIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MACHINE_VERSIONS() + { + this.MACHINES = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public double VERSION { get; set; } + public int DEFAULT_CONFIGURATION_ID { get; set; } + + public virtual CONFIGURATION CONFIGURATION { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MACHINES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_COLORS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_COLORS.cs new file mode 100644 index 000000000..3a05bfc13 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_COLORS.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_COLORS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MEDIA_COLORS() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int COLOR { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_CONDITIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_CONDITIONS.cs new file mode 100644 index 000000000..d4127674f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_CONDITIONS.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_CONDITIONS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MEDIA_CONDITIONS() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_MATERIALS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_MATERIALS.cs new file mode 100644 index 000000000..ad0e44d0c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_MATERIALS.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_MATERIALS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MEDIA_MATERIALS() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_PURPOSES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_PURPOSES.cs new file mode 100644 index 000000000..0db016179 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MEDIA_PURPOSES.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class MEDIA_PURPOSES + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MEDIA_PURPOSES() + { + this.RMLs = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CODE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLs { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/ORGANIZATION.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/ORGANIZATION.cs new file mode 100644 index 000000000..68ca7f84c --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/ORGANIZATION.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class ORGANIZATION + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ORGANIZATION() + { + this.MACHINES = new HashSet(); + this.USERS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public int CONTACT_ID { get; set; } + public int ADDRESS_ID { get; set; } + + public virtual ADDRESS ADDRESS { get; set; } + public virtual CONTACT CONTACT { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MACHINES { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection USERS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/PERMISSION.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/PERMISSION.cs new file mode 100644 index 000000000..a8c6105c3 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/PERMISSION.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class PERMISSION + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public PERMISSION() + { + this.ROLES_PERMISSIONS = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ROLES_PERMISSIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs new file mode 100644 index 000000000..e43af9f36 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class RML + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public RML() + { + this.LIQUIDS_RML = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string MANUFACTURER { get; set; } + public int MATERIAL_ID { get; set; } + public int COLOR_ID { get; set; } + public int PURPOSE_ID { get; set; } + public int CONDITION_ID { get; set; } + public int LINEAR_MASS_DENSITY_UNIT_ID { get; set; } + public int FIBER_SHAPE_ID { get; set; } + public int FIBER_SYNTHESIS_ID { get; set; } + public double FIBER_SIZE { get; set; } + public int NUMBER_OF_FIBERS { get; set; } + public int PLIES_PER_FIBER { get; set; } + public int PLIES_PER_THREAD { get; set; } + public bool TWISTED { get; set; } + public bool AIR_ENTANGLEMENT { get; set; } + public bool LUBRICANT { get; set; } + public double TENSILE_STRENGTH { get; set; } + public double ELONGATION_AT_BREAK_PERCENTAGE { get; set; } + public double ESTIMATED_THREAD_DIAMETER { get; set; } + + public virtual FIBER_SHAPES FIBER_SHAPES { get; set; } + public virtual FIBER_SYNTHESIS FIBER_SYNTHESIS { get; set; } + public virtual LINEAR_MASS_DENSITY_UNITS LINEAR_MASS_DENSITY_UNITS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection LIQUIDS_RML { get; set; } + public virtual MEDIA_COLORS MEDIA_COLORS { get; set; } + public virtual MEDIA_CONDITIONS MEDIA_CONDITIONS { get; set; } + public virtual MEDIA_MATERIALS MEDIA_MATERIALS { get; set; } + public virtual MEDIA_PURPOSES MEDIA_PURPOSES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/ROLE.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/ROLE.cs new file mode 100644 index 000000000..f18f0663b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/ROLE.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class ROLE + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ROLE() + { + this.ROLES_PERMISSIONS = new HashSet(); + this.USERS_ROLES = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ROLES_PERMISSIONS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection USERS_ROLES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/ROLES_PERMISSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/ROLES_PERMISSIONS.cs new file mode 100644 index 000000000..910f18079 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/ROLES_PERMISSIONS.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class ROLES_PERMISSIONS + { + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int ROLE_ID { get; set; } + public int PERMISSION_ID { get; set; } + + public virtual PERMISSION PERMISSION { get; set; } + public virtual ROLE ROLE { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs new file mode 100644 index 000000000..903a4857a --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class RemoteDB : DbContext + { + public RemoteDB() + : base("name=RemoteDB") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public virtual DbSet ACTIONS { get; set; } + public virtual DbSet
ADDRESSES { get; set; } + public virtual DbSet APPLICATION_DISPLAY_PANEL_VERSIONS { get; set; } + public virtual DbSet APPLICATION_FIRMWARE_VERSIONS { get; set; } + public virtual DbSet APPLICATION_OS_VERSIONS { get; set; } + public virtual DbSet APPLICATION_VERSIONS { get; set; } + public virtual DbSet CONFIGURATIONS { get; set; } + public virtual DbSet CONFIGURATIONS_DISPENSERS { get; set; } + public virtual DbSet CONTACTS { get; set; } + public virtual DbSet DISPENSERS { get; set; } + public virtual DbSet EMBEDDED_FIRMWARE_VERSIONS { get; set; } + public virtual DbSet EMBEDDED_SOFTWARE_VERSIONS { get; set; } + public virtual DbSet EVENTS { get; set; } + public virtual DbSet EVENTS_ACTIONS { get; set; } + public virtual DbSet FIBER_SHAPES { get; set; } + public virtual DbSet FIBER_SYNTHESIS { get; set; } + public virtual DbSet HARDWARE_VERSIONS { get; set; } + public virtual DbSet LINEAR_MASS_DENSITY_UNITS { get; set; } + public virtual DbSet LIQUID_TYPES { get; set; } + public virtual DbSet LIQUIDS { get; set; } + public virtual DbSet LIQUIDS_RML { get; set; } + public virtual DbSet MACHINE_VERSIONS { get; set; } + public virtual DbSet MACHINES { get; set; } + public virtual DbSet MACHINES_EVENTS { get; set; } + public virtual DbSet MEDIA_COLORS { get; set; } + public virtual DbSet MEDIA_CONDITIONS { get; set; } + public virtual DbSet MEDIA_MATERIALS { get; set; } + public virtual DbSet MEDIA_PURPOSES { get; set; } + public virtual DbSet ORGANIZATIONS { get; set; } + public virtual DbSet PERMISSIONS { get; set; } + public virtual DbSet RMLs { get; set; } + public virtual DbSet ROLES { get; set; } + public virtual DbSet ROLES_PERMISSIONS { get; set; } + public virtual DbSet USERS { get; set; } + public virtual DbSet USERS_ROLES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.tt b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.tt new file mode 100644 index 000000000..2f65065ba --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.tt @@ -0,0 +1,636 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"RemoteADO.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); +var itemCollection = loader.CreateEdmItemCollection(inputFile); +var modelNamespace = loader.GetModelNamespace(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +var container = itemCollection.OfType().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +var codeNamespace = code.VsNamespaceSuggestion(); +if (!String.IsNullOrEmpty(codeNamespace)) +{ +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<# + PushIndent(" "); +} + +#> +using System; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Entity.Core.Objects; +using System.Linq; +<# +} +#> + +<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext +{ + public <#=code.Escape(container)#>() + : base("name=<#=container.Name#>") + { +<# +if (!loader.IsLazyLoadingEnabled(container)) +{ +#> + this.Configuration.LazyLoadingEnabled = false; +<# +} + +foreach (var entitySet in container.BaseEntitySets.OfType()) +{ + // Note: the DbSet members are defined below such that the getter and + // setter always have the same accessibility as the DbSet definition + if (Accessibility.ForReadOnlyProperty(entitySet) != "public") + { +#> + <#=codeStringGenerator.DbSetInitializer(entitySet)#> +<# + } +} +#> + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=codeStringGenerator.DbSet(entitySet)#> +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); + } +#> +} +<# + +if (!String.IsNullOrEmpty(codeNamespace)) +{ + PopIndent(); +#> +} +<# +} +#> +<#+ + +private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) +{ + if (typeMapper.IsComposable(edmFunction)) + { +#> + + [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] + <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> + } +<#+ + } + else + { +#> + + <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> + } +<#+ + if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); + } + } +} + +public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) +{ +#> + var <#=name#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ +} + +public const string TemplateId = "CSharp_DbContext_Context_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string DbSetInitializer(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} = Set<{1}>();", + _code.Escape(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs new file mode 100644 index 000000000..17bc2683d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs @@ -0,0 +1,10 @@ +// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. +// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer +// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model +// is open in the designer. + +// If no context and entity classes have been generated, it may be because you created an empty model but +// have not yet chosen which version of Entity Framework to use. To generate a context class and entity +// classes for your model, open the model in the designer, right-click on the designer surface, and +// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation +// Item...'. \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.cs new file mode 100644 index 000000000..7cc066228 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx new file mode 100644 index 000000000..5d48fdcd1 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -0,0 +1,2685 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram new file mode 100644 index 000000000..7a0050ae1 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.tt b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.tt new file mode 100644 index 000000000..97271473f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.tt @@ -0,0 +1,733 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"RemoteADO.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var fileManager = EntityFrameworkTemplateFileManager.Create(this); +var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) +{ + return string.Empty; +} + +WriteHeader(codeStringGenerator, fileManager); + +foreach (var entity in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false)#> +<#=codeStringGenerator.EntityClassOpening(entity)#> +{ +<# + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); + var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); + var complexProperties = typeMapper.GetComplexProperties(entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(entity); + if (simpleProperties.Any()) + { + foreach (var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(complexProperty)#> +<# + } + } + + var navigationProperties = typeMapper.GetNavigationProperties(entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] +<# + } +#> + <#=codeStringGenerator.NavigationProperty(navigationProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var complex in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = typeMapper.GetComplexProperties(complex); + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(complex); + if (simpleProperties.Any()) + { + foreach(var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(enumType.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<# + if (typeMapper.EnumIsFlags(enumType)) + { +#> +[Flags] +<# + } +#> +<#=codeStringGenerator.EnumOpening(enumType)#> +{ +<# + var foundOne = false; + + foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) + { + foundOne = true; +#> + <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, +<# + } + + if (foundOne) + { + this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); + } +#> +} +<# + EndNamespace(code); +} + +fileManager.Process(); + +#> +<#+ + +public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ +<#=codeStringGenerator.UsingDirectives(inHeader: true)#> +<#+ + fileManager.EndBlock(); +} + +public void BeginNamespace(CodeGenerationTools code) +{ + var codeNamespace = code.VsNamespaceSuggestion(); + if (!String.IsNullOrEmpty(codeNamespace)) + { +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<#+ + PushIndent(" "); + } +} + +public void EndNamespace(CodeGenerationTools code) +{ + if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) + { + PopIndent(); +#> +} +<#+ + } +} + +public const string TemplateId = "CSharp_DbContext_Types_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs new file mode 100644 index 000000000..6307c9f9b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class USER + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public USER() + { + this.MACHINES_EVENTS = new HashSet(); + this.USERS_ROLES = new HashSet(); + } + + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public string EMAIL { get; set; } + public string PASSWORD { get; set; } + public int ORGANIZATION_ID { get; set; } + public int CONTACT_ID { get; set; } + public int ADDRESS_ID { get; set; } + + public virtual ADDRESS ADDRESS { get; set; } + public virtual CONTACT CONTACT { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MACHINES_EVENTS { get; set; } + public virtual ORGANIZATION ORGANIZATION { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection USERS_ROLES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/USERS_ROLES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/USERS_ROLES.cs new file mode 100644 index 000000000..30a5cf961 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/USERS_ROLES.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class USERS_ROLES + { + public int ID { get; set; } + public System.Guid GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + public int USER_ID { get; set; } + public int ROLE_ID { get; set; } + + public virtual ROLE ROLE { get; set; } + public virtual USER USER { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs new file mode 100644 index 000000000..6fdd35983 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DAL.Remote.DB +{ + public partial class RemoteDB : DbContext + { + public RemoteDB(String path, bool isFile) : base(ComposeConnectionString(path, isFile)) + { + + } + + private static String ComposeConnectionString(String source, bool isFile) + { + if (!isFile) + { + return String.Format("metadata=res://*/DB.RemoteADO.csdl|res://*/DB.RemoteADO.ssdl|res://*/DB.RemoteADO.msl;provider=System.Data.SqlClient;provider connection string=\"data source={0};initial catalog=Tango;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework\"", source); + } + else + { + return null; + } + } + + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..14c18abcd --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Remote Data Access Layer")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj new file mode 100644 index 000000000..74ad020fc --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -0,0 +1,225 @@ + + + + + Debug + AnyCPU + {38197109-8610-4D3F-92B9-16D48DF94D7C} + Library + Properties + Tango.DAL.Remote + Tango.DAL.Remote + v4.6 + 512 + + + + + true + full + false + ..\Build\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + + + + + + ..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net46\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.EF6.1.0.106.0\lib\net46\System.Data.SQLite.EF6.dll + True + + + ..\packages\System.Data.SQLite.Linq.1.0.106.0\lib\net46\System.Data.SQLite.Linq.dll + True + + + + + + + + + + + + + GlobalVersionInfo.cs + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + True + True + RemoteADO.Context.tt + + + True + True + RemoteADO.tt + + + True + True + RemoteADO.edmx + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + + + + + + EntityModelCodeGenerator + RemoteADO.Designer.cs + + + RemoteADO.edmx + + + + + + TextTemplatingFileGenerator + RemoteADO.edmx + RemoteADO.Context.cs + + + TextTemplatingFileGenerator + RemoteADO.edmx + RemoteADO.cs + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/packages.config b/Software/Visual_Studio/Tango.DAL.Remote/packages.config new file mode 100644 index 000000000..bee3cc627 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/App.config b/Software/Visual_Studio/Tango.DAL/App.config deleted file mode 100644 index da64f12b6..000000000 --- a/Software/Visual_Studio/Tango.DAL/App.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Class1.cs b/Software/Visual_Studio/Tango.DAL/Class1.cs deleted file mode 100644 index fa0ec8e29..000000000 --- a/Software/Visual_Studio/Tango.DAL/Class1.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DAL -{ - public class Class1 - { - public Class1() - { - Local.LocalDB db = new Local.LocalDB(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/ACTION.cs b/Software/Visual_Studio/Tango.DAL/Local/ACTION.cs deleted file mode 100644 index 453e9fa2f..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/ACTION.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class ACTION - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/ADDRESS.cs b/Software/Visual_Studio/Tango.DAL/Local/ADDRESS.cs deleted file mode 100644 index 4f0b4f223..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/ADDRESS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class ADDRESS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_FIRMWARE_VERSIONS.cs deleted file mode 100644 index 2b7d9e8db..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_FIRMWARE_VERSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_FIRMWARE_VERSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_OS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_OS_VERSIONS.cs deleted file mode 100644 index 4bf53ad0e..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_OS_VERSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_OS_VERSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_VERSION.cs b/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_VERSION.cs deleted file mode 100644 index d770a26c6..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/APPLICATION_VERSION.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_VERSION - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/CONFIGURATION.cs b/Software/Visual_Studio/Tango.DAL/Local/CONFIGURATION.cs deleted file mode 100644 index 506c0c7e5..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/CONFIGURATION.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class CONFIGURATION - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/CONFIGURATIONS_DISPENSERS.cs b/Software/Visual_Studio/Tango.DAL/Local/CONFIGURATIONS_DISPENSERS.cs deleted file mode 100644 index 1263b5ae2..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/CONFIGURATIONS_DISPENSERS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class CONFIGURATIONS_DISPENSERS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/CONTACT.cs b/Software/Visual_Studio/Tango.DAL/Local/CONTACT.cs deleted file mode 100644 index 16a7cf5b3..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/CONTACT.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class CONTACT - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/DISPENSER.cs b/Software/Visual_Studio/Tango.DAL/Local/DISPENSER.cs deleted file mode 100644 index f9a58c32f..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/DISPENSER.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class DISPENSER - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_FIRMWARE_VERSIONS.cs deleted file mode 100644 index 1829bf889..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_FIRMWARE_VERSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class EMBEDDED_FIRMWARE_VERSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_SOFTWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_SOFTWARE_VERSIONS.cs deleted file mode 100644 index b9c436f07..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/EMBEDDED_SOFTWARE_VERSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class EMBEDDED_SOFTWARE_VERSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/EVENT.cs b/Software/Visual_Studio/Tango.DAL/Local/EVENT.cs deleted file mode 100644 index 58a0e3787..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/EVENT.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class EVENT - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/EVENTS_ACTIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/EVENTS_ACTIONS.cs deleted file mode 100644 index 6d1489135..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/EVENTS_ACTIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class EVENTS_ACTIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/FIBER_SHAPES.cs b/Software/Visual_Studio/Tango.DAL/Local/FIBER_SHAPES.cs deleted file mode 100644 index 97cea26f8..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/FIBER_SHAPES.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class FIBER_SHAPES - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/FIBER_SYNTHESIS.cs b/Software/Visual_Studio/Tango.DAL/Local/FIBER_SYNTHESIS.cs deleted file mode 100644 index cef1e4762..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/FIBER_SYNTHESIS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class FIBER_SYNTHESIS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/HARDWARE_VERSIONS.cs deleted file mode 100644 index 54c60031f..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/HARDWARE_VERSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class HARDWARE_VERSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/LINEAR_MASS_DENSITY_UNITS.cs b/Software/Visual_Studio/Tango.DAL/Local/LINEAR_MASS_DENSITY_UNITS.cs deleted file mode 100644 index 3e46c893b..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LINEAR_MASS_DENSITY_UNITS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class LINEAR_MASS_DENSITY_UNITS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/LIQUID.cs b/Software/Visual_Studio/Tango.DAL/Local/LIQUID.cs deleted file mode 100644 index 9d7cef88a..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LIQUID.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class LIQUID - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/LIQUIDS_RML.cs b/Software/Visual_Studio/Tango.DAL/Local/LIQUIDS_RML.cs deleted file mode 100644 index 7c82eb97d..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LIQUIDS_RML.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class LIQUIDS_RML - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/LIQUID_TYPES.cs b/Software/Visual_Studio/Tango.DAL/Local/LIQUID_TYPES.cs deleted file mode 100644 index e4d63758b..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LIQUID_TYPES.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class LIQUID_TYPES - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.cs b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.cs deleted file mode 100644 index 0a8a75211..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Infrastructure; - - public partial class LocalDB : DbContext - { - public LocalDB() - : base("name=LocalDB") - { - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - - public virtual DbSet ACTIONS { get; set; } - public virtual DbSet
ADDRESSES { get; set; } - public virtual DbSet APPLICATION_FIRMWARE_VERSIONS { get; set; } - public virtual DbSet APPLICATION_OS_VERSIONS { get; set; } - public virtual DbSet APPLICATION_VERSION { get; set; } - public virtual DbSet CONFIGURATIONS { get; set; } - public virtual DbSet CONFIGURATIONS_DISPENSERS { get; set; } - public virtual DbSet CONTACTS { get; set; } - public virtual DbSet DISPENSERS { get; set; } - public virtual DbSet EMBEDDED_FIRMWARE_VERSIONS { get; set; } - public virtual DbSet EMBEDDED_SOFTWARE_VERSIONS { get; set; } - public virtual DbSet EVENTS { get; set; } - public virtual DbSet EVENTS_ACTIONS { get; set; } - public virtual DbSet FIBER_SHAPES { get; set; } - public virtual DbSet FIBER_SYNTHESIS { get; set; } - public virtual DbSet HARDWARE_VERSIONS { get; set; } - public virtual DbSet LINEAR_MASS_DENSITY_UNITS { get; set; } - public virtual DbSet LIQUID_TYPES { get; set; } - public virtual DbSet LIQUIDS { get; set; } - public virtual DbSet LIQUIDS_RML { get; set; } - public virtual DbSet MACHINE_VERSIONS { get; set; } - public virtual DbSet MACHINES { get; set; } - public virtual DbSet MACHINES_EVENTS { get; set; } - public virtual DbSet MEDIA_COLORS { get; set; } - public virtual DbSet MEDIA_CONDITIONS { get; set; } - public virtual DbSet MEDIA_MATERIALS { get; set; } - public virtual DbSet MEDIA_PURPOSES { get; set; } - public virtual DbSet ORGANIZATIONS { get; set; } - public virtual DbSet PERMISSIONS { get; set; } - public virtual DbSet RMLs { get; set; } - public virtual DbSet ROLES { get; set; } - public virtual DbSet ROLES_PERMISSIONS { get; set; } - public virtual DbSet USERS { get; set; } - public virtual DbSet USERS_ROLES { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.tt b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.tt deleted file mode 100644 index 058773afd..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Context.tt +++ /dev/null @@ -1,636 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF6.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -const string inputFile = @"LocalADO.edmx"; -var textTransform = DynamicTextTransformation.Create(this); -var code = new CodeGenerationTools(this); -var ef = new MetadataTools(this); -var typeMapper = new TypeMapper(code, ef, textTransform.Errors); -var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); -var itemCollection = loader.CreateEdmItemCollection(inputFile); -var modelNamespace = loader.GetModelNamespace(inputFile); -var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); - -var container = itemCollection.OfType().FirstOrDefault(); -if (container == null) -{ - return string.Empty; -} -#> -//------------------------------------------------------------------------------ -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<# - -var codeNamespace = code.VsNamespaceSuggestion(); -if (!String.IsNullOrEmpty(codeNamespace)) -{ -#> -namespace <#=code.EscapeNamespace(codeNamespace)#> -{ -<# - PushIndent(" "); -} - -#> -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -<# -if (container.FunctionImports.Any()) -{ -#> -using System.Data.Entity.Core.Objects; -using System.Linq; -<# -} -#> - -<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext -{ - public <#=code.Escape(container)#>() - : base("name=<#=container.Name#>") - { -<# -if (!loader.IsLazyLoadingEnabled(container)) -{ -#> - this.Configuration.LazyLoadingEnabled = false; -<# -} - -foreach (var entitySet in container.BaseEntitySets.OfType()) -{ - // Note: the DbSet members are defined below such that the getter and - // setter always have the same accessibility as the DbSet definition - if (Accessibility.ForReadOnlyProperty(entitySet) != "public") - { -#> - <#=codeStringGenerator.DbSetInitializer(entitySet)#> -<# - } -} -#> - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - -<# - foreach (var entitySet in container.BaseEntitySets.OfType()) - { -#> - <#=codeStringGenerator.DbSet(entitySet)#> -<# - } - - foreach (var edmFunction in container.FunctionImports) - { - WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); - } -#> -} -<# - -if (!String.IsNullOrEmpty(codeNamespace)) -{ - PopIndent(); -#> -} -<# -} -#> -<#+ - -private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) -{ - if (typeMapper.IsComposable(edmFunction)) - { -#> - - [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] - <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> - { -<#+ - codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); -#> - <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> - } -<#+ - } - else - { -#> - - <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> - { -<#+ - codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); -#> - <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> - } -<#+ - if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) - { - WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); - } - } -} - -public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) -{ -#> - var <#=name#> = <#=isNotNull#> ? - <#=notNullInit#> : - <#=nullInit#>; - -<#+ -} - -public const string TemplateId = "CSharp_DbContext_Context_EF6"; - -public class CodeStringGenerator -{ - private readonly CodeGenerationTools _code; - private readonly TypeMapper _typeMapper; - private readonly MetadataTools _ef; - - public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(typeMapper, "typeMapper"); - ArgumentNotNull(ef, "ef"); - - _code = code; - _typeMapper = typeMapper; - _ef = ef; - } - - public string Property(EdmProperty edmProperty) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - Accessibility.ForProperty(edmProperty), - _typeMapper.GetTypeName(edmProperty.TypeUsage), - _code.Escape(edmProperty), - _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); - } - - public string NavigationProperty(NavigationProperty navProp) - { - var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), - navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - _code.Escape(navProp), - _code.SpaceAfter(Accessibility.ForGetter(navProp)), - _code.SpaceAfter(Accessibility.ForSetter(navProp))); - } - - public string AccessibilityAndVirtual(string accessibility) - { - return accessibility + (accessibility != "private" ? " virtual" : ""); - } - - public string EntityClassOpening(EntityType entity) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1}partial class {2}{3}", - Accessibility.ForType(entity), - _code.SpaceAfter(_code.AbstractOption(entity)), - _code.Escape(entity), - _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); - } - - public string EnumOpening(SimpleType enumType) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} enum {1} : {2}", - Accessibility.ForType(enumType), - _code.Escape(enumType), - _code.Escape(_typeMapper.UnderlyingClrType(enumType))); - } - - public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) - { - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; - writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); - } - } - - public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "{0} IQueryable<{1}> {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - _code.Escape(edmFunction), - string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); - } - - public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - edmFunction.NamespaceName, - edmFunction.Name, - string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), - _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); - } - - public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); - if (includeMergeOption) - { - paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } - - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - _code.Escape(edmFunction), - paramList); - } - - public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", - returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - edmFunction.Name, - callParams); - } - - public string DbSet(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} virtual DbSet<{1}> {2} {{ get; set; }}", - Accessibility.ForReadOnlyProperty(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType), - _code.Escape(entitySet)); - } - - public string DbSetInitializer(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} = Set<{1}>();", - _code.Escape(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType)); - } - - public string UsingDirectives(bool inHeader, bool includeCollections = true) - { - return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) - ? string.Format( - CultureInfo.InvariantCulture, - "{0}using System;{1}" + - "{2}", - inHeader ? Environment.NewLine : "", - includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", - inHeader ? "" : Environment.NewLine) - : ""; - } -} - -public class TypeMapper -{ - private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; - - private readonly System.Collections.IList _errors; - private readonly CodeGenerationTools _code; - private readonly MetadataTools _ef; - - public static string FixNamespaces(string typeName) - { - return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); - } - - public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(ef, "ef"); - ArgumentNotNull(errors, "errors"); - - _code = code; - _ef = ef; - _errors = errors; - } - - public string GetTypeName(TypeUsage typeUsage) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); - } - - public string GetTypeName(EdmType edmType) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: null); - } - - public string GetTypeName(TypeUsage typeUsage, string modelNamespace) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); - } - - public string GetTypeName(EdmType edmType, string modelNamespace) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); - } - - public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) - { - if (edmType == null) - { - return null; - } - - var collectionType = edmType as CollectionType; - if (collectionType != null) - { - return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); - } - - var typeName = _code.Escape(edmType.MetadataProperties - .Where(p => p.Name == ExternalTypeNameAttributeName) - .Select(p => (string)p.Value) - .FirstOrDefault()) - ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? - _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : - _code.Escape(edmType)); - - if (edmType is StructuralType) - { - return typeName; - } - - if (edmType is SimpleType) - { - var clrType = UnderlyingClrType(edmType); - if (!IsEnumType(edmType)) - { - typeName = _code.Escape(clrType); - } - - typeName = FixNamespaces(typeName); - - return clrType.IsValueType && isNullable == true ? - String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : - typeName; - } - - throw new ArgumentException("edmType"); - } - - public Type UnderlyingClrType(EdmType edmType) - { - ArgumentNotNull(edmType, "edmType"); - - var primitiveType = edmType as PrimitiveType; - if (primitiveType != null) - { - return primitiveType.ClrEquivalentType; - } - - if (IsEnumType(edmType)) - { - return GetEnumUnderlyingType(edmType).ClrEquivalentType; - } - - return typeof(object); - } - - public object GetEnumMemberValue(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var valueProperty = enumMember.GetType().GetProperty("Value"); - return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); - } - - public string GetEnumMemberName(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var nameProperty = enumMember.GetType().GetProperty("Name"); - return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); - } - - public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var membersProperty = enumType.GetType().GetProperty("Members"); - return membersProperty != null - ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) - : Enumerable.Empty(); - } - - public bool EnumIsFlags(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); - return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); - } - - public bool IsEnumType(GlobalItem edmType) - { - ArgumentNotNull(edmType, "edmType"); - - return edmType.GetType().Name == "EnumType"; - } - - public PrimitiveType GetEnumUnderlyingType(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); - } - - public string CreateLiteral(object value) - { - if (value == null || value.GetType() != typeof(TimeSpan)) - { - return _code.CreateLiteral(value); - } - - return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); - } - - public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) - { - ArgumentNotNull(types, "types"); - ArgumentNotNull(sourceFile, "sourceFile"); - - var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); - if (types.Any(item => !hash.Add(item))) - { - _errors.Add( - new CompilerError(sourceFile, -1, -1, "6023", - String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); - return false; - } - return true; - } - - public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) - { - return GetItemsToGenerate(itemCollection) - .Where(e => IsEnumType(e)); - } - - public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType - { - return itemCollection - .OfType() - .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) - .OrderBy(i => i.Name); - } - - public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) - { - return itemCollection - .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) - .Select(g => GetGlobalItemName(g)); - } - - public string GetGlobalItemName(GlobalItem item) - { - if (item is EdmType) - { - return ((EdmType)item).Name; - } - else - { - return ((EntityContainer)item).Name; - } - } - - public IEnumerable GetSimpleProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetSimpleProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetPropertiesWithDefaultValues(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type); - } - - public IEnumerable GetCollectionNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - } - - public FunctionParameter GetReturnParameter(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); - return returnParamsProperty == null - ? edmFunction.ReturnParameter - : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); - } - - public bool IsComposable(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); - return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); - } - - public IEnumerable GetParameters(EdmFunction edmFunction) - { - return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - } - - public TypeUsage GetReturnType(EdmFunction edmFunction) - { - var returnParam = GetReturnParameter(edmFunction); - return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); - } - - public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) - { - var returnType = GetReturnType(edmFunction); - return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - } -} - -public static void ArgumentNotNull(T arg, string name) where T : class -{ - if (arg == null) - { - throw new ArgumentNullException(name); - } -} -#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Designer.cs b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Designer.cs deleted file mode 100644 index 9b904ed35..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.Designer.cs +++ /dev/null @@ -1,10 +0,0 @@ -// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL\Local\LocalADO.edmx'. -// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer -// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model -// is open in the designer. - -// If no context and entity classes have been generated, it may be because you created an empty model but -// have not yet chosen which version of Entity Framework to use. To generate a context class and entity -// classes for your model, open the model in the designer, right-click on the designer surface, and -// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation -// Item...'. \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.cs b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.cs deleted file mode 100644 index 7cc066228..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.cs +++ /dev/null @@ -1,9 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx deleted file mode 100644 index d33a577d6..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx +++ /dev/null @@ -1,1066 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx.diagram deleted file mode 100644 index 0cbd0d8b0..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.edmx.diagram +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.tt b/Software/Visual_Studio/Tango.DAL/Local/LocalADO.tt deleted file mode 100644 index 4acc3fed3..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/LocalADO.tt +++ /dev/null @@ -1,733 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF6.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -const string inputFile = @"LocalADO.edmx"; -var textTransform = DynamicTextTransformation.Create(this); -var code = new CodeGenerationTools(this); -var ef = new MetadataTools(this); -var typeMapper = new TypeMapper(code, ef, textTransform.Errors); -var fileManager = EntityFrameworkTemplateFileManager.Create(this); -var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); -var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); - -if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) -{ - return string.Empty; -} - -WriteHeader(codeStringGenerator, fileManager); - -foreach (var entity in typeMapper.GetItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(entity.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false)#> -<#=codeStringGenerator.EntityClassOpening(entity)#> -{ -<# - var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); - var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); - var complexProperties = typeMapper.GetComplexProperties(entity); - - if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) - { -#> - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public <#=code.Escape(entity)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var navigationProperty in collectionNavigationProperties) - { -#> - this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var simpleProperties = typeMapper.GetSimpleProperties(entity); - if (simpleProperties.Any()) - { - foreach (var edmProperty in simpleProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var complexProperty in complexProperties) - { -#> - <#=codeStringGenerator.Property(complexProperty)#> -<# - } - } - - var navigationProperties = typeMapper.GetNavigationProperties(entity); - if (navigationProperties.Any()) - { -#> - -<# - foreach (var navigationProperty in navigationProperties) - { - if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) - { -#> - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] -<# - } -#> - <#=codeStringGenerator.NavigationProperty(navigationProperty)#> -<# - } - } -#> -} -<# - EndNamespace(code); -} - -foreach (var complex in typeMapper.GetItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(complex.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> -{ -<# - var complexProperties = typeMapper.GetComplexProperties(complex); - var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); - - if (propertiesWithDefaultValues.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(complex)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var simpleProperties = typeMapper.GetSimpleProperties(complex); - if (simpleProperties.Any()) - { - foreach(var edmProperty in simpleProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var edmProperty in complexProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } -#> -} -<# - EndNamespace(code); -} - -foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(enumType.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> -<# - if (typeMapper.EnumIsFlags(enumType)) - { -#> -[Flags] -<# - } -#> -<#=codeStringGenerator.EnumOpening(enumType)#> -{ -<# - var foundOne = false; - - foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) - { - foundOne = true; -#> - <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, -<# - } - - if (foundOne) - { - this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); - } -#> -} -<# - EndNamespace(code); -} - -fileManager.Process(); - -#> -<#+ - -public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) -{ - fileManager.StartHeader(); -#> -//------------------------------------------------------------------------------ -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ -<#=codeStringGenerator.UsingDirectives(inHeader: true)#> -<#+ - fileManager.EndBlock(); -} - -public void BeginNamespace(CodeGenerationTools code) -{ - var codeNamespace = code.VsNamespaceSuggestion(); - if (!String.IsNullOrEmpty(codeNamespace)) - { -#> -namespace <#=code.EscapeNamespace(codeNamespace)#> -{ -<#+ - PushIndent(" "); - } -} - -public void EndNamespace(CodeGenerationTools code) -{ - if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) - { - PopIndent(); -#> -} -<#+ - } -} - -public const string TemplateId = "CSharp_DbContext_Types_EF6"; - -public class CodeStringGenerator -{ - private readonly CodeGenerationTools _code; - private readonly TypeMapper _typeMapper; - private readonly MetadataTools _ef; - - public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(typeMapper, "typeMapper"); - ArgumentNotNull(ef, "ef"); - - _code = code; - _typeMapper = typeMapper; - _ef = ef; - } - - public string Property(EdmProperty edmProperty) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - Accessibility.ForProperty(edmProperty), - _typeMapper.GetTypeName(edmProperty.TypeUsage), - _code.Escape(edmProperty), - _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); - } - - public string NavigationProperty(NavigationProperty navProp) - { - var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), - navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - _code.Escape(navProp), - _code.SpaceAfter(Accessibility.ForGetter(navProp)), - _code.SpaceAfter(Accessibility.ForSetter(navProp))); - } - - public string AccessibilityAndVirtual(string accessibility) - { - return accessibility + (accessibility != "private" ? " virtual" : ""); - } - - public string EntityClassOpening(EntityType entity) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1}partial class {2}{3}", - Accessibility.ForType(entity), - _code.SpaceAfter(_code.AbstractOption(entity)), - _code.Escape(entity), - _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); - } - - public string EnumOpening(SimpleType enumType) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} enum {1} : {2}", - Accessibility.ForType(enumType), - _code.Escape(enumType), - _code.Escape(_typeMapper.UnderlyingClrType(enumType))); - } - - public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) - { - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; - writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); - } - } - - public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "{0} IQueryable<{1}> {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - _code.Escape(edmFunction), - string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); - } - - public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - edmFunction.NamespaceName, - edmFunction.Name, - string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), - _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); - } - - public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); - if (includeMergeOption) - { - paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } - - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - _code.Escape(edmFunction), - paramList); - } - - public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", - returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - edmFunction.Name, - callParams); - } - - public string DbSet(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} virtual DbSet<{1}> {2} {{ get; set; }}", - Accessibility.ForReadOnlyProperty(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType), - _code.Escape(entitySet)); - } - - public string UsingDirectives(bool inHeader, bool includeCollections = true) - { - return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) - ? string.Format( - CultureInfo.InvariantCulture, - "{0}using System;{1}" + - "{2}", - inHeader ? Environment.NewLine : "", - includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", - inHeader ? "" : Environment.NewLine) - : ""; - } -} - -public class TypeMapper -{ - private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; - - private readonly System.Collections.IList _errors; - private readonly CodeGenerationTools _code; - private readonly MetadataTools _ef; - - public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(ef, "ef"); - ArgumentNotNull(errors, "errors"); - - _code = code; - _ef = ef; - _errors = errors; - } - - public static string FixNamespaces(string typeName) - { - return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); - } - - public string GetTypeName(TypeUsage typeUsage) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); - } - - public string GetTypeName(EdmType edmType) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: null); - } - - public string GetTypeName(TypeUsage typeUsage, string modelNamespace) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); - } - - public string GetTypeName(EdmType edmType, string modelNamespace) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); - } - - public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) - { - if (edmType == null) - { - return null; - } - - var collectionType = edmType as CollectionType; - if (collectionType != null) - { - return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); - } - - var typeName = _code.Escape(edmType.MetadataProperties - .Where(p => p.Name == ExternalTypeNameAttributeName) - .Select(p => (string)p.Value) - .FirstOrDefault()) - ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? - _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : - _code.Escape(edmType)); - - if (edmType is StructuralType) - { - return typeName; - } - - if (edmType is SimpleType) - { - var clrType = UnderlyingClrType(edmType); - if (!IsEnumType(edmType)) - { - typeName = _code.Escape(clrType); - } - - typeName = FixNamespaces(typeName); - - return clrType.IsValueType && isNullable == true ? - String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : - typeName; - } - - throw new ArgumentException("edmType"); - } - - public Type UnderlyingClrType(EdmType edmType) - { - ArgumentNotNull(edmType, "edmType"); - - var primitiveType = edmType as PrimitiveType; - if (primitiveType != null) - { - return primitiveType.ClrEquivalentType; - } - - if (IsEnumType(edmType)) - { - return GetEnumUnderlyingType(edmType).ClrEquivalentType; - } - - return typeof(object); - } - - public object GetEnumMemberValue(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var valueProperty = enumMember.GetType().GetProperty("Value"); - return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); - } - - public string GetEnumMemberName(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var nameProperty = enumMember.GetType().GetProperty("Name"); - return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); - } - - public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var membersProperty = enumType.GetType().GetProperty("Members"); - return membersProperty != null - ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) - : Enumerable.Empty(); - } - - public bool EnumIsFlags(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); - return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); - } - - public bool IsEnumType(GlobalItem edmType) - { - ArgumentNotNull(edmType, "edmType"); - - return edmType.GetType().Name == "EnumType"; - } - - public PrimitiveType GetEnumUnderlyingType(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); - } - - public string CreateLiteral(object value) - { - if (value == null || value.GetType() != typeof(TimeSpan)) - { - return _code.CreateLiteral(value); - } - - return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); - } - - public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) - { - ArgumentNotNull(types, "types"); - ArgumentNotNull(sourceFile, "sourceFile"); - - var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); - if (types.Any(item => !hash.Add(item))) - { - _errors.Add( - new CompilerError(sourceFile, -1, -1, "6023", - String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); - return false; - } - return true; - } - - public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) - { - return GetItemsToGenerate(itemCollection) - .Where(e => IsEnumType(e)); - } - - public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType - { - return itemCollection - .OfType() - .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) - .OrderBy(i => i.Name); - } - - public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) - { - return itemCollection - .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) - .Select(g => GetGlobalItemName(g)); - } - - public string GetGlobalItemName(GlobalItem item) - { - if (item is EdmType) - { - return ((EdmType)item).Name; - } - else - { - return ((EntityContainer)item).Name; - } - } - - public IEnumerable GetSimpleProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetSimpleProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetPropertiesWithDefaultValues(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type); - } - - public IEnumerable GetCollectionNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - } - - public FunctionParameter GetReturnParameter(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); - return returnParamsProperty == null - ? edmFunction.ReturnParameter - : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); - } - - public bool IsComposable(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); - return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); - } - - public IEnumerable GetParameters(EdmFunction edmFunction) - { - return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - } - - public TypeUsage GetReturnType(EdmFunction edmFunction) - { - var returnParam = GetReturnParameter(edmFunction); - return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); - } - - public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) - { - var returnType = GetReturnType(edmFunction); - return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - } -} - -public static void ArgumentNotNull(T arg, string name) where T : class -{ - if (arg == null) - { - throw new ArgumentNullException(name); - } -} -#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Local/MACHINE.cs b/Software/Visual_Studio/Tango.DAL/Local/MACHINE.cs deleted file mode 100644 index e152d45e7..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MACHINE.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MACHINE - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/MACHINES_EVENTS.cs b/Software/Visual_Studio/Tango.DAL/Local/MACHINES_EVENTS.cs deleted file mode 100644 index 405b349ef..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MACHINES_EVENTS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MACHINES_EVENTS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/MACHINE_VERSIONS.cs deleted file mode 100644 index d5965201f..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MACHINE_VERSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MACHINE_VERSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_COLORS.cs b/Software/Visual_Studio/Tango.DAL/Local/MEDIA_COLORS.cs deleted file mode 100644 index c2c5ba7a2..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_COLORS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_COLORS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_CONDITIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/MEDIA_CONDITIONS.cs deleted file mode 100644 index 1d8d62cab..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_CONDITIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_CONDITIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_MATERIALS.cs b/Software/Visual_Studio/Tango.DAL/Local/MEDIA_MATERIALS.cs deleted file mode 100644 index 03f8b9c61..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_MATERIALS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_MATERIALS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_PURPOSES.cs b/Software/Visual_Studio/Tango.DAL/Local/MEDIA_PURPOSES.cs deleted file mode 100644 index 1a439f435..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/MEDIA_PURPOSES.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_PURPOSES - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/ORGANIZATION.cs b/Software/Visual_Studio/Tango.DAL/Local/ORGANIZATION.cs deleted file mode 100644 index 825c3c3f7..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/ORGANIZATION.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class ORGANIZATION - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/PERMISSION.cs b/Software/Visual_Studio/Tango.DAL/Local/PERMISSION.cs deleted file mode 100644 index 65d304100..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/PERMISSION.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class PERMISSION - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/RML.cs b/Software/Visual_Studio/Tango.DAL/Local/RML.cs deleted file mode 100644 index b7271ecaf..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/RML.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class RML - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/ROLE.cs b/Software/Visual_Studio/Tango.DAL/Local/ROLE.cs deleted file mode 100644 index 856d6417a..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/ROLE.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class ROLE - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/ROLES_PERMISSIONS.cs b/Software/Visual_Studio/Tango.DAL/Local/ROLES_PERMISSIONS.cs deleted file mode 100644 index a37c39808..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/ROLES_PERMISSIONS.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class ROLES_PERMISSIONS - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/USER.cs b/Software/Visual_Studio/Tango.DAL/Local/USER.cs deleted file mode 100644 index fb5a35e68..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/USER.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class USER - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Local/USERS_ROLES.cs b/Software/Visual_Studio/Tango.DAL/Local/USERS_ROLES.cs deleted file mode 100644 index c83adc195..000000000 --- a/Software/Visual_Studio/Tango.DAL/Local/USERS_ROLES.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local -{ - using System; - using System.Collections.Generic; - - public partial class USERS_ROLES - { - public long ID { get; set; } - public System.Guid GUID { get; set; } - public Nullable LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Partials/LocalDB.cs b/Software/Visual_Studio/Tango.DAL/Partials/LocalDB.cs deleted file mode 100644 index b067ac6e3..000000000 --- a/Software/Visual_Studio/Tango.DAL/Partials/LocalDB.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DAL.Local -{ - public partial class LocalDB : DbContext - { - public LocalDB(String filePath) : base(ComposeConnectionString(filePath)) - { - - } - - private static String ComposeConnectionString(String filePath) - { - //TODO: implement file connection strings. - return null; - } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Partials/ServerDB.cs b/Software/Visual_Studio/Tango.DAL/Partials/ServerDB.cs deleted file mode 100644 index fedbfd117..000000000 --- a/Software/Visual_Studio/Tango.DAL/Partials/ServerDB.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DAL -{ - public class ServerDB : DbContext - { - public ServerDB(String path, bool isFile) : base(ComposeConnectionString(path, isFile)) - { - - } - - private static String ComposeConnectionString(String path, bool isFile) - { - //TODO: implement file and server connection strings. - return null; - } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DAL/Properties/AssemblyInfo.cs deleted file mode 100644 index 370dd5e05..000000000 --- a/Software/Visual_Studio/Tango.DAL/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Tango - Data Access Layer")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Server/ACTION.cs b/Software/Visual_Studio/Tango.DAL/Server/ACTION.cs deleted file mode 100644 index 29cb2c743..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ACTION.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class ACTION - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public ACTION() - { - this.EVENTS_ACTIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int CODE { get; set; } - public string NAME { get; set; } - public string DESCRIPTION { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection EVENTS_ACTIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/ADDRESS.cs b/Software/Visual_Studio/Tango.DAL/Server/ADDRESS.cs deleted file mode 100644 index 5e03a0e41..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ADDRESS.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class ADDRESS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public ADDRESS() - { - this.ORGANIZATIONS = new HashSet(); - this.USERS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string ADDRESS1 { get; set; } - public string LOCALITY { get; set; } - public string COUNTRY { get; set; } - public string CITY { get; set; } - public string STATE { get; set; } - public string COUNTRY_CODE { get; set; } - public string POSTAL_CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection ORGANIZATIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection USERS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_DISPLAY_PANEL_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_DISPLAY_PANEL_VERSIONS.cs deleted file mode 100644 index 78f32085f..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_DISPLAY_PANEL_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_DISPLAY_PANEL_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public APPLICATION_DISPLAY_PANEL_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_FIRMWARE_VERSIONS.cs deleted file mode 100644 index cfbfcc003..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_FIRMWARE_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_FIRMWARE_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public APPLICATION_FIRMWARE_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_OS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_OS_VERSIONS.cs deleted file mode 100644 index ae1e44231..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_OS_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_OS_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public APPLICATION_OS_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_VERSIONS.cs deleted file mode 100644 index 09d52db49..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/APPLICATION_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class APPLICATION_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public APPLICATION_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/CONFIGURATION.cs b/Software/Visual_Studio/Tango.DAL/Server/CONFIGURATION.cs deleted file mode 100644 index eb00a7d15..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/CONFIGURATION.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class CONFIGURATION - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public CONFIGURATION() - { - this.CONFIGURATIONS_DISPENSERS = new HashSet(); - this.MACHINE_VERSIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public System.DateTime CREATION_DATE { get; set; } - public int MACHINE_ID { get; set; } - public int APPLICATION_VERSION_ID { get; set; } - public int APPLICATION_OS_VERSION_ID { get; set; } - public int APPLICATION_FIRMWARE_VERSION_ID { get; set; } - public int APPLICATION_DISPLAY_PANEL_VERSION_ID { get; set; } - public int EMBEDDED_FIRMWARE_VERSION_ID { get; set; } - public int EMBEDDED_SOFTWARE_VERSION_ID { get; set; } - public int HARDWARE_VERSION_ID { get; set; } - - public virtual APPLICATION_DISPLAY_PANEL_VERSIONS APPLICATION_DISPLAY_PANEL_VERSIONS { get; set; } - public virtual APPLICATION_FIRMWARE_VERSIONS APPLICATION_FIRMWARE_VERSIONS { get; set; } - public virtual APPLICATION_OS_VERSIONS APPLICATION_OS_VERSIONS { get; set; } - public virtual APPLICATION_VERSIONS APPLICATION_VERSIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS_DISPENSERS { get; set; } - public virtual EMBEDDED_FIRMWARE_VERSIONS EMBEDDED_FIRMWARE_VERSIONS { get; set; } - public virtual EMBEDDED_SOFTWARE_VERSIONS EMBEDDED_SOFTWARE_VERSIONS { get; set; } - public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } - public virtual MACHINE MACHINE { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINE_VERSIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/CONFIGURATIONS_DISPENSERS.cs b/Software/Visual_Studio/Tango.DAL/Server/CONFIGURATIONS_DISPENSERS.cs deleted file mode 100644 index 1f992944d..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/CONFIGURATIONS_DISPENSERS.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class CONFIGURATIONS_DISPENSERS - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int CONFIGURATION_ID { get; set; } - public int DISPENSER_ID { get; set; } - public int LIQUID_ID { get; set; } - - public virtual CONFIGURATION CONFIGURATION { get; set; } - public virtual DISPENSER DISPENSER { get; set; } - public virtual LIQUID LIQUID { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/CONTACT.cs b/Software/Visual_Studio/Tango.DAL/Server/CONTACT.cs deleted file mode 100644 index 1487a5469..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/CONTACT.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class CONTACT - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public CONTACT() - { - this.ORGANIZATIONS = new HashSet(); - this.USERS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string FIRST_NAME { get; set; } - public string LAST_NAME { get; set; } - public string FULL_NAME { get; set; } - public string EMAIL { get; set; } - public string PHONE_NUMBER { get; set; } - public string FAX { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection ORGANIZATIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection USERS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/DISPENSER.cs b/Software/Visual_Studio/Tango.DAL/Server/DISPENSER.cs deleted file mode 100644 index 13d028189..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/DISPENSER.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class DISPENSER - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public DISPENSER() - { - this.CONFIGURATIONS_DISPENSERS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS_DISPENSERS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_FIRMWARE_VERSIONS.cs deleted file mode 100644 index 7b2729d88..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_FIRMWARE_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class EMBEDDED_FIRMWARE_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public EMBEDDED_FIRMWARE_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_SOFTWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_SOFTWARE_VERSIONS.cs deleted file mode 100644 index 6acdefd0f..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/EMBEDDED_SOFTWARE_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class EMBEDDED_SOFTWARE_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public EMBEDDED_SOFTWARE_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/EVENT.cs b/Software/Visual_Studio/Tango.DAL/Server/EVENT.cs deleted file mode 100644 index e018f5f39..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/EVENT.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class EVENT - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public EVENT() - { - this.EVENTS_ACTIONS = new HashSet(); - this.MACHINES_EVENTS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int CODE { get; set; } - public string NAME { get; set; } - public string DESCRIPTION { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection EVENTS_ACTIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES_EVENTS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/EVENTS_ACTIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/EVENTS_ACTIONS.cs deleted file mode 100644 index bc69dd833..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/EVENTS_ACTIONS.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class EVENTS_ACTIONS - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int EVENT_ID { get; set; } - public int ACTION_ID { get; set; } - - public virtual ACTION ACTION { get; set; } - public virtual EVENT EVENT { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/FIBER_SHAPES.cs b/Software/Visual_Studio/Tango.DAL/Server/FIBER_SHAPES.cs deleted file mode 100644 index 09daa4056..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/FIBER_SHAPES.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class FIBER_SHAPES - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public FIBER_SHAPES() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/FIBER_SYNTHESIS.cs b/Software/Visual_Studio/Tango.DAL/Server/FIBER_SYNTHESIS.cs deleted file mode 100644 index c2f1fa847..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/FIBER_SYNTHESIS.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class FIBER_SYNTHESIS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public FIBER_SYNTHESIS() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/HARDWARE_VERSIONS.cs deleted file mode 100644 index 39e14abef..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/HARDWARE_VERSIONS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class HARDWARE_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public HARDWARE_VERSIONS() - { - this.CONFIGURATIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/LINEAR_MASS_DENSITY_UNITS.cs b/Software/Visual_Studio/Tango.DAL/Server/LINEAR_MASS_DENSITY_UNITS.cs deleted file mode 100644 index ec9ca0836..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/LINEAR_MASS_DENSITY_UNITS.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class LINEAR_MASS_DENSITY_UNITS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public LINEAR_MASS_DENSITY_UNITS() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/LIQUID.cs b/Software/Visual_Studio/Tango.DAL/Server/LIQUID.cs deleted file mode 100644 index ed3185986..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/LIQUID.cs +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class LIQUID - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public LIQUID() - { - this.CONFIGURATIONS_DISPENSERS = new HashSet(); - this.LIQUIDS_RML = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public double VERSION { get; set; } - public int LIQUID_TYPE_ID { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS_DISPENSERS { get; set; } - public virtual LIQUID_TYPES LIQUID_TYPES { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection LIQUIDS_RML { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/LIQUIDS_RML.cs b/Software/Visual_Studio/Tango.DAL/Server/LIQUIDS_RML.cs deleted file mode 100644 index c0ce89bb3..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/LIQUIDS_RML.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class LIQUIDS_RML - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int LIQUID_ID { get; set; } - public int RML_ID { get; set; } - - public virtual LIQUID LIQUID { get; set; } - public virtual RML RML { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/LIQUID_TYPES.cs b/Software/Visual_Studio/Tango.DAL/Server/LIQUID_TYPES.cs deleted file mode 100644 index 9600f7b01..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/LIQUID_TYPES.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class LIQUID_TYPES - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public LIQUID_TYPES() - { - this.LIQUIDS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public string DESCRIPTION { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection LIQUIDS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MACHINE.cs b/Software/Visual_Studio/Tango.DAL/Server/MACHINE.cs deleted file mode 100644 index a2cd90798..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MACHINE.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MACHINE - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public MACHINE() - { - this.CONFIGURATIONS = new HashSet(); - this.MACHINES_EVENTS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string SERIAL_NUMBER { get; set; } - public System.DateTime PRODUCTION_DATE { get; set; } - public int ORGANIZATION_ID { get; set; } - public int MACHINE_VERSION_ID { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CONFIGURATIONS { get; set; } - public virtual MACHINE_VERSIONS MACHINE_VERSIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES_EVENTS { get; set; } - public virtual ORGANIZATION ORGANIZATION { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MACHINES_EVENTS.cs b/Software/Visual_Studio/Tango.DAL/Server/MACHINES_EVENTS.cs deleted file mode 100644 index 83d1efd4d..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MACHINES_EVENTS.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MACHINES_EVENTS - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int MACHINE_ID { get; set; } - public int EVENT_ID { get; set; } - public int USER_ID { get; set; } - public System.DateTime DATE_TIME { get; set; } - public string DESCRIPTION { get; set; } - - public virtual EVENT EVENT { get; set; } - public virtual MACHINE MACHINE { get; set; } - public virtual USER USER { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/MACHINE_VERSIONS.cs deleted file mode 100644 index 614d87c17..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MACHINE_VERSIONS.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MACHINE_VERSIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public MACHINE_VERSIONS() - { - this.MACHINES = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public double VERSION { get; set; } - public int DEFAULT_CONFIGURATION_ID { get; set; } - - public virtual CONFIGURATION CONFIGURATION { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_COLORS.cs b/Software/Visual_Studio/Tango.DAL/Server/MEDIA_COLORS.cs deleted file mode 100644 index dadf7a615..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_COLORS.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_COLORS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public MEDIA_COLORS() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int COLOR { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_CONDITIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/MEDIA_CONDITIONS.cs deleted file mode 100644 index 65a10ac37..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_CONDITIONS.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_CONDITIONS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public MEDIA_CONDITIONS() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_MATERIALS.cs b/Software/Visual_Studio/Tango.DAL/Server/MEDIA_MATERIALS.cs deleted file mode 100644 index f64a19e64..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_MATERIALS.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_MATERIALS - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public MEDIA_MATERIALS() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_PURPOSES.cs b/Software/Visual_Studio/Tango.DAL/Server/MEDIA_PURPOSES.cs deleted file mode 100644 index 93195785c..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/MEDIA_PURPOSES.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class MEDIA_PURPOSES - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public MEDIA_PURPOSES() - { - this.RMLs = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CODE { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLs { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/ORGANIZATION.cs b/Software/Visual_Studio/Tango.DAL/Server/ORGANIZATION.cs deleted file mode 100644 index ce4f7cb65..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ORGANIZATION.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class ORGANIZATION - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public ORGANIZATION() - { - this.MACHINES = new HashSet(); - this.USERS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public int CONTACT_ID { get; set; } - public int ADDRESS_ID { get; set; } - - public virtual ADDRESS ADDRESS { get; set; } - public virtual CONTACT CONTACT { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection USERS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/PERMISSION.cs b/Software/Visual_Studio/Tango.DAL/Server/PERMISSION.cs deleted file mode 100644 index c3497f3a4..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/PERMISSION.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class PERMISSION - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public PERMISSION() - { - this.ROLES_PERMISSIONS = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public string DESCRIPTION { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection ROLES_PERMISSIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/RML.cs b/Software/Visual_Studio/Tango.DAL/Server/RML.cs deleted file mode 100644 index 342354455..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/RML.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class RML - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public RML() - { - this.LIQUIDS_RML = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string MANUFACTURER { get; set; } - public int MATERIAL_ID { get; set; } - public int COLOR_ID { get; set; } - public int PURPOSE_ID { get; set; } - public int CONDITION_ID { get; set; } - public int LINEAR_MASS_DENSITY_UNIT_ID { get; set; } - public int FIBER_SHAPE_ID { get; set; } - public int FIBER_SYNTHESIS_ID { get; set; } - public double FIBER_SIZE { get; set; } - public int NUMBER_OF_FIBERS { get; set; } - public int PLIES_PER_FIBER { get; set; } - public int PLIES_PER_THREAD { get; set; } - public bool TWISTED { get; set; } - public bool AIR_ENTANGLEMENT { get; set; } - public bool LUBRICANT { get; set; } - public double TENSILE_STRENGTH { get; set; } - public double ELONGATION_AT_BREAK_PERCENTAGE { get; set; } - public double ESTIMATED_THREAD_DIAMETER { get; set; } - - public virtual FIBER_SHAPES FIBER_SHAPES { get; set; } - public virtual FIBER_SYNTHESIS FIBER_SYNTHESIS { get; set; } - public virtual LINEAR_MASS_DENSITY_UNITS LINEAR_MASS_DENSITY_UNITS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection LIQUIDS_RML { get; set; } - public virtual MEDIA_COLORS MEDIA_COLORS { get; set; } - public virtual MEDIA_CONDITIONS MEDIA_CONDITIONS { get; set; } - public virtual MEDIA_MATERIALS MEDIA_MATERIALS { get; set; } - public virtual MEDIA_PURPOSES MEDIA_PURPOSES { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/ROLE.cs b/Software/Visual_Studio/Tango.DAL/Server/ROLE.cs deleted file mode 100644 index d01063593..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ROLE.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class ROLE - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public ROLE() - { - this.ROLES_PERMISSIONS = new HashSet(); - this.USERS_ROLES = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string NAME { get; set; } - public string DESCRIPTION { get; set; } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection ROLES_PERMISSIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection USERS_ROLES { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/ROLES_PERMISSIONS.cs b/Software/Visual_Studio/Tango.DAL/Server/ROLES_PERMISSIONS.cs deleted file mode 100644 index e8c474918..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ROLES_PERMISSIONS.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class ROLES_PERMISSIONS - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int ROLE_ID { get; set; } - public int PERMISSION_ID { get; set; } - - public virtual PERMISSION PERMISSION { get; set; } - public virtual ROLE ROLE { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.cs b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.cs deleted file mode 100644 index 1012c5955..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.cs +++ /dev/null @@ -1,64 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Infrastructure; - - public partial class ServerDB : DbContext - { - public ServerDB() - : base("name=ServerDB") - { - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - - public virtual DbSet ACTIONS { get; set; } - public virtual DbSet
ADDRESSES { get; set; } - public virtual DbSet APPLICATION_DISPLAY_PANEL_VERSIONS { get; set; } - public virtual DbSet APPLICATION_FIRMWARE_VERSIONS { get; set; } - public virtual DbSet APPLICATION_OS_VERSIONS { get; set; } - public virtual DbSet APPLICATION_VERSIONS { get; set; } - public virtual DbSet CONFIGURATIONS { get; set; } - public virtual DbSet CONFIGURATIONS_DISPENSERS { get; set; } - public virtual DbSet CONTACTS { get; set; } - public virtual DbSet DISPENSERS { get; set; } - public virtual DbSet EMBEDDED_FIRMWARE_VERSIONS { get; set; } - public virtual DbSet EMBEDDED_SOFTWARE_VERSIONS { get; set; } - public virtual DbSet EVENTS { get; set; } - public virtual DbSet EVENTS_ACTIONS { get; set; } - public virtual DbSet FIBER_SHAPES { get; set; } - public virtual DbSet FIBER_SYNTHESIS { get; set; } - public virtual DbSet HARDWARE_VERSIONS { get; set; } - public virtual DbSet LINEAR_MASS_DENSITY_UNITS { get; set; } - public virtual DbSet LIQUID_TYPES { get; set; } - public virtual DbSet LIQUIDS { get; set; } - public virtual DbSet LIQUIDS_RML { get; set; } - public virtual DbSet MACHINE_VERSIONS { get; set; } - public virtual DbSet MACHINES { get; set; } - public virtual DbSet MACHINES_EVENTS { get; set; } - public virtual DbSet MEDIA_COLORS { get; set; } - public virtual DbSet MEDIA_CONDITIONS { get; set; } - public virtual DbSet MEDIA_MATERIALS { get; set; } - public virtual DbSet MEDIA_PURPOSES { get; set; } - public virtual DbSet ORGANIZATIONS { get; set; } - public virtual DbSet PERMISSIONS { get; set; } - public virtual DbSet RMLs { get; set; } - public virtual DbSet ROLES { get; set; } - public virtual DbSet ROLES_PERMISSIONS { get; set; } - public virtual DbSet USERS { get; set; } - public virtual DbSet USERS_ROLES { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.tt b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.tt deleted file mode 100644 index a95d77359..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Context.tt +++ /dev/null @@ -1,636 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF6.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -const string inputFile = @"ServerADO.edmx"; -var textTransform = DynamicTextTransformation.Create(this); -var code = new CodeGenerationTools(this); -var ef = new MetadataTools(this); -var typeMapper = new TypeMapper(code, ef, textTransform.Errors); -var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); -var itemCollection = loader.CreateEdmItemCollection(inputFile); -var modelNamespace = loader.GetModelNamespace(inputFile); -var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); - -var container = itemCollection.OfType().FirstOrDefault(); -if (container == null) -{ - return string.Empty; -} -#> -//------------------------------------------------------------------------------ -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<# - -var codeNamespace = code.VsNamespaceSuggestion(); -if (!String.IsNullOrEmpty(codeNamespace)) -{ -#> -namespace <#=code.EscapeNamespace(codeNamespace)#> -{ -<# - PushIndent(" "); -} - -#> -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -<# -if (container.FunctionImports.Any()) -{ -#> -using System.Data.Entity.Core.Objects; -using System.Linq; -<# -} -#> - -<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext -{ - public <#=code.Escape(container)#>() - : base("name=<#=container.Name#>") - { -<# -if (!loader.IsLazyLoadingEnabled(container)) -{ -#> - this.Configuration.LazyLoadingEnabled = false; -<# -} - -foreach (var entitySet in container.BaseEntitySets.OfType()) -{ - // Note: the DbSet members are defined below such that the getter and - // setter always have the same accessibility as the DbSet definition - if (Accessibility.ForReadOnlyProperty(entitySet) != "public") - { -#> - <#=codeStringGenerator.DbSetInitializer(entitySet)#> -<# - } -} -#> - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - -<# - foreach (var entitySet in container.BaseEntitySets.OfType()) - { -#> - <#=codeStringGenerator.DbSet(entitySet)#> -<# - } - - foreach (var edmFunction in container.FunctionImports) - { - WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); - } -#> -} -<# - -if (!String.IsNullOrEmpty(codeNamespace)) -{ - PopIndent(); -#> -} -<# -} -#> -<#+ - -private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) -{ - if (typeMapper.IsComposable(edmFunction)) - { -#> - - [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] - <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> - { -<#+ - codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); -#> - <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> - } -<#+ - } - else - { -#> - - <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> - { -<#+ - codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); -#> - <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> - } -<#+ - if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) - { - WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); - } - } -} - -public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) -{ -#> - var <#=name#> = <#=isNotNull#> ? - <#=notNullInit#> : - <#=nullInit#>; - -<#+ -} - -public const string TemplateId = "CSharp_DbContext_Context_EF6"; - -public class CodeStringGenerator -{ - private readonly CodeGenerationTools _code; - private readonly TypeMapper _typeMapper; - private readonly MetadataTools _ef; - - public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(typeMapper, "typeMapper"); - ArgumentNotNull(ef, "ef"); - - _code = code; - _typeMapper = typeMapper; - _ef = ef; - } - - public string Property(EdmProperty edmProperty) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - Accessibility.ForProperty(edmProperty), - _typeMapper.GetTypeName(edmProperty.TypeUsage), - _code.Escape(edmProperty), - _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); - } - - public string NavigationProperty(NavigationProperty navProp) - { - var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), - navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - _code.Escape(navProp), - _code.SpaceAfter(Accessibility.ForGetter(navProp)), - _code.SpaceAfter(Accessibility.ForSetter(navProp))); - } - - public string AccessibilityAndVirtual(string accessibility) - { - return accessibility + (accessibility != "private" ? " virtual" : ""); - } - - public string EntityClassOpening(EntityType entity) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1}partial class {2}{3}", - Accessibility.ForType(entity), - _code.SpaceAfter(_code.AbstractOption(entity)), - _code.Escape(entity), - _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); - } - - public string EnumOpening(SimpleType enumType) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} enum {1} : {2}", - Accessibility.ForType(enumType), - _code.Escape(enumType), - _code.Escape(_typeMapper.UnderlyingClrType(enumType))); - } - - public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) - { - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; - writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); - } - } - - public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "{0} IQueryable<{1}> {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - _code.Escape(edmFunction), - string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); - } - - public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - edmFunction.NamespaceName, - edmFunction.Name, - string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), - _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); - } - - public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); - if (includeMergeOption) - { - paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } - - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - _code.Escape(edmFunction), - paramList); - } - - public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", - returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - edmFunction.Name, - callParams); - } - - public string DbSet(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} virtual DbSet<{1}> {2} {{ get; set; }}", - Accessibility.ForReadOnlyProperty(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType), - _code.Escape(entitySet)); - } - - public string DbSetInitializer(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} = Set<{1}>();", - _code.Escape(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType)); - } - - public string UsingDirectives(bool inHeader, bool includeCollections = true) - { - return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) - ? string.Format( - CultureInfo.InvariantCulture, - "{0}using System;{1}" + - "{2}", - inHeader ? Environment.NewLine : "", - includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", - inHeader ? "" : Environment.NewLine) - : ""; - } -} - -public class TypeMapper -{ - private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; - - private readonly System.Collections.IList _errors; - private readonly CodeGenerationTools _code; - private readonly MetadataTools _ef; - - public static string FixNamespaces(string typeName) - { - return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); - } - - public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(ef, "ef"); - ArgumentNotNull(errors, "errors"); - - _code = code; - _ef = ef; - _errors = errors; - } - - public string GetTypeName(TypeUsage typeUsage) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); - } - - public string GetTypeName(EdmType edmType) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: null); - } - - public string GetTypeName(TypeUsage typeUsage, string modelNamespace) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); - } - - public string GetTypeName(EdmType edmType, string modelNamespace) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); - } - - public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) - { - if (edmType == null) - { - return null; - } - - var collectionType = edmType as CollectionType; - if (collectionType != null) - { - return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); - } - - var typeName = _code.Escape(edmType.MetadataProperties - .Where(p => p.Name == ExternalTypeNameAttributeName) - .Select(p => (string)p.Value) - .FirstOrDefault()) - ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? - _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : - _code.Escape(edmType)); - - if (edmType is StructuralType) - { - return typeName; - } - - if (edmType is SimpleType) - { - var clrType = UnderlyingClrType(edmType); - if (!IsEnumType(edmType)) - { - typeName = _code.Escape(clrType); - } - - typeName = FixNamespaces(typeName); - - return clrType.IsValueType && isNullable == true ? - String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : - typeName; - } - - throw new ArgumentException("edmType"); - } - - public Type UnderlyingClrType(EdmType edmType) - { - ArgumentNotNull(edmType, "edmType"); - - var primitiveType = edmType as PrimitiveType; - if (primitiveType != null) - { - return primitiveType.ClrEquivalentType; - } - - if (IsEnumType(edmType)) - { - return GetEnumUnderlyingType(edmType).ClrEquivalentType; - } - - return typeof(object); - } - - public object GetEnumMemberValue(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var valueProperty = enumMember.GetType().GetProperty("Value"); - return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); - } - - public string GetEnumMemberName(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var nameProperty = enumMember.GetType().GetProperty("Name"); - return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); - } - - public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var membersProperty = enumType.GetType().GetProperty("Members"); - return membersProperty != null - ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) - : Enumerable.Empty(); - } - - public bool EnumIsFlags(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); - return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); - } - - public bool IsEnumType(GlobalItem edmType) - { - ArgumentNotNull(edmType, "edmType"); - - return edmType.GetType().Name == "EnumType"; - } - - public PrimitiveType GetEnumUnderlyingType(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); - } - - public string CreateLiteral(object value) - { - if (value == null || value.GetType() != typeof(TimeSpan)) - { - return _code.CreateLiteral(value); - } - - return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); - } - - public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) - { - ArgumentNotNull(types, "types"); - ArgumentNotNull(sourceFile, "sourceFile"); - - var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); - if (types.Any(item => !hash.Add(item))) - { - _errors.Add( - new CompilerError(sourceFile, -1, -1, "6023", - String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); - return false; - } - return true; - } - - public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) - { - return GetItemsToGenerate(itemCollection) - .Where(e => IsEnumType(e)); - } - - public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType - { - return itemCollection - .OfType() - .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) - .OrderBy(i => i.Name); - } - - public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) - { - return itemCollection - .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) - .Select(g => GetGlobalItemName(g)); - } - - public string GetGlobalItemName(GlobalItem item) - { - if (item is EdmType) - { - return ((EdmType)item).Name; - } - else - { - return ((EntityContainer)item).Name; - } - } - - public IEnumerable GetSimpleProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetSimpleProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetPropertiesWithDefaultValues(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type); - } - - public IEnumerable GetCollectionNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - } - - public FunctionParameter GetReturnParameter(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); - return returnParamsProperty == null - ? edmFunction.ReturnParameter - : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); - } - - public bool IsComposable(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); - return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); - } - - public IEnumerable GetParameters(EdmFunction edmFunction) - { - return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - } - - public TypeUsage GetReturnType(EdmFunction edmFunction) - { - var returnParam = GetReturnParameter(edmFunction); - return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); - } - - public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) - { - var returnType = GetReturnType(edmFunction); - return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - } -} - -public static void ArgumentNotNull(T arg, string name) where T : class -{ - if (arg == null) - { - throw new ArgumentNullException(name); - } -} -#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Designer.cs b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Designer.cs deleted file mode 100644 index 5fa6d05e8..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.Designer.cs +++ /dev/null @@ -1,10 +0,0 @@ -// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL\Server\ServerADO.edmx'. -// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer -// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model -// is open in the designer. - -// If no context and entity classes have been generated, it may be because you created an empty model but -// have not yet chosen which version of Entity Framework to use. To generate a context class and entity -// classes for your model, open the model in the designer, right-click on the designer surface, and -// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation -// Item...'. \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.cs b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.cs deleted file mode 100644 index 7cc066228..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.cs +++ /dev/null @@ -1,9 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx deleted file mode 100644 index f6cee39ed..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx +++ /dev/null @@ -1,2685 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx.diagram deleted file mode 100644 index c03862854..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.edmx.diagram +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.tt b/Software/Visual_Studio/Tango.DAL/Server/ServerADO.tt deleted file mode 100644 index b09ff06f5..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/ServerADO.tt +++ /dev/null @@ -1,733 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF6.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -const string inputFile = @"ServerADO.edmx"; -var textTransform = DynamicTextTransformation.Create(this); -var code = new CodeGenerationTools(this); -var ef = new MetadataTools(this); -var typeMapper = new TypeMapper(code, ef, textTransform.Errors); -var fileManager = EntityFrameworkTemplateFileManager.Create(this); -var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); -var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); - -if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) -{ - return string.Empty; -} - -WriteHeader(codeStringGenerator, fileManager); - -foreach (var entity in typeMapper.GetItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(entity.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false)#> -<#=codeStringGenerator.EntityClassOpening(entity)#> -{ -<# - var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); - var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); - var complexProperties = typeMapper.GetComplexProperties(entity); - - if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) - { -#> - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public <#=code.Escape(entity)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var navigationProperty in collectionNavigationProperties) - { -#> - this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var simpleProperties = typeMapper.GetSimpleProperties(entity); - if (simpleProperties.Any()) - { - foreach (var edmProperty in simpleProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var complexProperty in complexProperties) - { -#> - <#=codeStringGenerator.Property(complexProperty)#> -<# - } - } - - var navigationProperties = typeMapper.GetNavigationProperties(entity); - if (navigationProperties.Any()) - { -#> - -<# - foreach (var navigationProperty in navigationProperties) - { - if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) - { -#> - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] -<# - } -#> - <#=codeStringGenerator.NavigationProperty(navigationProperty)#> -<# - } - } -#> -} -<# - EndNamespace(code); -} - -foreach (var complex in typeMapper.GetItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(complex.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> -{ -<# - var complexProperties = typeMapper.GetComplexProperties(complex); - var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); - - if (propertiesWithDefaultValues.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(complex)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var simpleProperties = typeMapper.GetSimpleProperties(complex); - if (simpleProperties.Any()) - { - foreach(var edmProperty in simpleProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var edmProperty in complexProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } -#> -} -<# - EndNamespace(code); -} - -foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(enumType.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> -<# - if (typeMapper.EnumIsFlags(enumType)) - { -#> -[Flags] -<# - } -#> -<#=codeStringGenerator.EnumOpening(enumType)#> -{ -<# - var foundOne = false; - - foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) - { - foundOne = true; -#> - <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, -<# - } - - if (foundOne) - { - this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); - } -#> -} -<# - EndNamespace(code); -} - -fileManager.Process(); - -#> -<#+ - -public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) -{ - fileManager.StartHeader(); -#> -//------------------------------------------------------------------------------ -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ -<#=codeStringGenerator.UsingDirectives(inHeader: true)#> -<#+ - fileManager.EndBlock(); -} - -public void BeginNamespace(CodeGenerationTools code) -{ - var codeNamespace = code.VsNamespaceSuggestion(); - if (!String.IsNullOrEmpty(codeNamespace)) - { -#> -namespace <#=code.EscapeNamespace(codeNamespace)#> -{ -<#+ - PushIndent(" "); - } -} - -public void EndNamespace(CodeGenerationTools code) -{ - if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) - { - PopIndent(); -#> -} -<#+ - } -} - -public const string TemplateId = "CSharp_DbContext_Types_EF6"; - -public class CodeStringGenerator -{ - private readonly CodeGenerationTools _code; - private readonly TypeMapper _typeMapper; - private readonly MetadataTools _ef; - - public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(typeMapper, "typeMapper"); - ArgumentNotNull(ef, "ef"); - - _code = code; - _typeMapper = typeMapper; - _ef = ef; - } - - public string Property(EdmProperty edmProperty) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - Accessibility.ForProperty(edmProperty), - _typeMapper.GetTypeName(edmProperty.TypeUsage), - _code.Escape(edmProperty), - _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); - } - - public string NavigationProperty(NavigationProperty navProp) - { - var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), - navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - _code.Escape(navProp), - _code.SpaceAfter(Accessibility.ForGetter(navProp)), - _code.SpaceAfter(Accessibility.ForSetter(navProp))); - } - - public string AccessibilityAndVirtual(string accessibility) - { - return accessibility + (accessibility != "private" ? " virtual" : ""); - } - - public string EntityClassOpening(EntityType entity) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1}partial class {2}{3}", - Accessibility.ForType(entity), - _code.SpaceAfter(_code.AbstractOption(entity)), - _code.Escape(entity), - _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); - } - - public string EnumOpening(SimpleType enumType) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} enum {1} : {2}", - Accessibility.ForType(enumType), - _code.Escape(enumType), - _code.Escape(_typeMapper.UnderlyingClrType(enumType))); - } - - public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) - { - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; - writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); - } - } - - public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "{0} IQueryable<{1}> {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - _code.Escape(edmFunction), - string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); - } - - public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - edmFunction.NamespaceName, - edmFunction.Name, - string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), - _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); - } - - public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); - if (includeMergeOption) - { - paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } - - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - _code.Escape(edmFunction), - paramList); - } - - public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", - returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - edmFunction.Name, - callParams); - } - - public string DbSet(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} virtual DbSet<{1}> {2} {{ get; set; }}", - Accessibility.ForReadOnlyProperty(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType), - _code.Escape(entitySet)); - } - - public string UsingDirectives(bool inHeader, bool includeCollections = true) - { - return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) - ? string.Format( - CultureInfo.InvariantCulture, - "{0}using System;{1}" + - "{2}", - inHeader ? Environment.NewLine : "", - includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", - inHeader ? "" : Environment.NewLine) - : ""; - } -} - -public class TypeMapper -{ - private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; - - private readonly System.Collections.IList _errors; - private readonly CodeGenerationTools _code; - private readonly MetadataTools _ef; - - public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(ef, "ef"); - ArgumentNotNull(errors, "errors"); - - _code = code; - _ef = ef; - _errors = errors; - } - - public static string FixNamespaces(string typeName) - { - return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); - } - - public string GetTypeName(TypeUsage typeUsage) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); - } - - public string GetTypeName(EdmType edmType) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: null); - } - - public string GetTypeName(TypeUsage typeUsage, string modelNamespace) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); - } - - public string GetTypeName(EdmType edmType, string modelNamespace) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); - } - - public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) - { - if (edmType == null) - { - return null; - } - - var collectionType = edmType as CollectionType; - if (collectionType != null) - { - return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); - } - - var typeName = _code.Escape(edmType.MetadataProperties - .Where(p => p.Name == ExternalTypeNameAttributeName) - .Select(p => (string)p.Value) - .FirstOrDefault()) - ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? - _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : - _code.Escape(edmType)); - - if (edmType is StructuralType) - { - return typeName; - } - - if (edmType is SimpleType) - { - var clrType = UnderlyingClrType(edmType); - if (!IsEnumType(edmType)) - { - typeName = _code.Escape(clrType); - } - - typeName = FixNamespaces(typeName); - - return clrType.IsValueType && isNullable == true ? - String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : - typeName; - } - - throw new ArgumentException("edmType"); - } - - public Type UnderlyingClrType(EdmType edmType) - { - ArgumentNotNull(edmType, "edmType"); - - var primitiveType = edmType as PrimitiveType; - if (primitiveType != null) - { - return primitiveType.ClrEquivalentType; - } - - if (IsEnumType(edmType)) - { - return GetEnumUnderlyingType(edmType).ClrEquivalentType; - } - - return typeof(object); - } - - public object GetEnumMemberValue(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var valueProperty = enumMember.GetType().GetProperty("Value"); - return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); - } - - public string GetEnumMemberName(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var nameProperty = enumMember.GetType().GetProperty("Name"); - return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); - } - - public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var membersProperty = enumType.GetType().GetProperty("Members"); - return membersProperty != null - ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) - : Enumerable.Empty(); - } - - public bool EnumIsFlags(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); - return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); - } - - public bool IsEnumType(GlobalItem edmType) - { - ArgumentNotNull(edmType, "edmType"); - - return edmType.GetType().Name == "EnumType"; - } - - public PrimitiveType GetEnumUnderlyingType(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); - } - - public string CreateLiteral(object value) - { - if (value == null || value.GetType() != typeof(TimeSpan)) - { - return _code.CreateLiteral(value); - } - - return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); - } - - public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) - { - ArgumentNotNull(types, "types"); - ArgumentNotNull(sourceFile, "sourceFile"); - - var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); - if (types.Any(item => !hash.Add(item))) - { - _errors.Add( - new CompilerError(sourceFile, -1, -1, "6023", - String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); - return false; - } - return true; - } - - public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) - { - return GetItemsToGenerate(itemCollection) - .Where(e => IsEnumType(e)); - } - - public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType - { - return itemCollection - .OfType() - .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) - .OrderBy(i => i.Name); - } - - public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) - { - return itemCollection - .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) - .Select(g => GetGlobalItemName(g)); - } - - public string GetGlobalItemName(GlobalItem item) - { - if (item is EdmType) - { - return ((EdmType)item).Name; - } - else - { - return ((EntityContainer)item).Name; - } - } - - public IEnumerable GetSimpleProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetSimpleProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetComplexProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable GetPropertiesWithDefaultValues(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable GetNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type); - } - - public IEnumerable GetCollectionNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - } - - public FunctionParameter GetReturnParameter(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); - return returnParamsProperty == null - ? edmFunction.ReturnParameter - : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); - } - - public bool IsComposable(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); - return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); - } - - public IEnumerable GetParameters(EdmFunction edmFunction) - { - return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - } - - public TypeUsage GetReturnType(EdmFunction edmFunction) - { - var returnParam = GetReturnParameter(edmFunction); - return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); - } - - public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) - { - var returnType = GetReturnType(edmFunction); - return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - } -} - -public static void ArgumentNotNull(T arg, string name) where T : class -{ - if (arg == null) - { - throw new ArgumentNullException(name); - } -} -#> \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/Server/USER.cs b/Software/Visual_Studio/Tango.DAL/Server/USER.cs deleted file mode 100644 index 596a373aa..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/USER.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class USER - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public USER() - { - this.MACHINES_EVENTS = new HashSet(); - this.USERS_ROLES = new HashSet(); - } - - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string EMAIL { get; set; } - public string PASSWORD { get; set; } - public int ORGANIZATION_ID { get; set; } - public int CONTACT_ID { get; set; } - public int ADDRESS_ID { get; set; } - - public virtual ADDRESS ADDRESS { get; set; } - public virtual CONTACT CONTACT { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES_EVENTS { get; set; } - public virtual ORGANIZATION ORGANIZATION { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection USERS_ROLES { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Server/USERS_ROLES.cs b/Software/Visual_Studio/Tango.DAL/Server/USERS_ROLES.cs deleted file mode 100644 index d9e18c2b5..000000000 --- a/Software/Visual_Studio/Tango.DAL/Server/USERS_ROLES.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Server -{ - using System; - using System.Collections.Generic; - - public partial class USERS_ROLES - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public int USER_ID { get; set; } - public int ROLE_ID { get; set; } - - public virtual ROLE ROLE { get; set; } - public virtual USER USER { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL/Tango.DAL.csproj b/Software/Visual_Studio/Tango.DAL/Tango.DAL.csproj deleted file mode 100644 index cc9e99c3d..000000000 --- a/Software/Visual_Studio/Tango.DAL/Tango.DAL.csproj +++ /dev/null @@ -1,363 +0,0 @@ - - - - - Debug - AnyCPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E} - Library - Properties - Tango.DAL - Tango.DAL - v4.6 - 512 - - - - - - true - full - false - ..\Build\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll - - - ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll - - - - - - ..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net46\System.Data.SQLite.dll - - - ..\packages\System.Data.SQLite.EF6.1.0.106.0\lib\net46\System.Data.SQLite.EF6.dll - True - - - ..\packages\System.Data.SQLite.Linq.1.0.106.0\lib\net46\System.Data.SQLite.Linq.dll - True - - - - - - - - - - - - - GlobalVersionInfo.cs - - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - True - True - LocalADO.Context.tt - - - True - True - LocalADO.tt - - - True - True - LocalADO.edmx - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - LocalADO.tt - - - - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - ServerADO.tt - - - True - True - ServerADO.Context.tt - - - True - True - ServerADO.tt - - - True - True - ServerADO.edmx - - - ServerADO.tt - - - ServerADO.tt - - - - - - EntityModelCodeGenerator - LocalADO.Designer.cs - - - LocalADO.edmx - - - - EntityModelCodeGenerator - ServerADO.Designer.cs - - - ServerADO.edmx - - - - - - - - - TextTemplatingFileGenerator - LocalADO.edmx - LocalADO.Context.cs - - - TextTemplatingFileGenerator - LocalADO.edmx - LocalADO.cs - - - TextTemplatingFileGenerator - ServerADO.edmx - ServerADO.Context.cs - - - TextTemplatingFileGenerator - ServerADO.edmx - ServerADO.cs - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL/packages.config b/Software/Visual_Studio/Tango.DAL/packages.config deleted file mode 100644 index d412cd302..000000000 --- a/Software/Visual_Studio/Tango.DAL/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/App.config b/Software/Visual_Studio/Tango.UnitTesting/App.config new file mode 100644 index 000000000..901eeb586 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/App.config @@ -0,0 +1,20 @@ + + + + +
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs new file mode 100644 index 000000000..b56f04c70 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Tango.DAL; +using System.Linq; + +namespace Tango.UnitTesting +{ + [TestClass] + [TestCategory("DAL")] + public class DAL_TST + { + [TestMethod] + public void Validate_Server_SQLServer_Connection() + { + Guid guid = Guid.NewGuid(); + + using (var db = new DAL.Remote.DB.RemoteDB("LOCALHOST\\SQLEXPRESS", false)) + { + var action = new DAL.Remote.DB.ACTION(); + action.CODE = 1; + action.NAME = "Action 1"; + action.DESCRIPTION = "Description 1"; + action.GUID = guid; + action.LAST_UPDATED = DateTime.Now; + + db.ACTIONS.Add(action); + db.SaveChanges(); + } + + using (var db = new DAL.Remote.DB.RemoteDB("LOCALHOST\\SQLEXPRESS", false)) + { + var action = db.ACTIONS.Single(x => x.GUID == guid); + db.ACTIONS.Remove(action); + db.SaveChanges(); + } + } + + [TestMethod] + public void Validate_Local_SQLite_Connection() + { + String guid = Guid.NewGuid().ToString(); + + using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath())) + { + var action = new DAL.Local.DB.ACTION(); + action.CODE = 1; + action.NAME = "Action 1"; + action.DESCRIPTION = "Description 1"; + action.GUID = guid; + + db.ACTIONS.Add(action); + db.SaveChanges(); + } + + using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath())) + { + var actions = db.ACTIONS.ToList(); + var action = db.ACTIONS.Single(x => x.GUID == guid); + db.ACTIONS.Remove(action); + db.SaveChanges(); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs index ece74d3f3..21e36168c 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs @@ -34,6 +34,15 @@ namespace Tango.UnitTesting return Path.GetFullPath(@"..\..\..\PMR\Messages\"); } + /// + /// Gets the SQLite database file path in DB folder. + /// + /// + public static String GetSQLiteFilePath() + { + return Path.GetFullPath(@"..\..\..\DB\Tango.db"); + } + /// /// Initializes the logging manager. /// diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 02a500341..494981db1 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -40,6 +40,12 @@ 4 + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll @@ -53,7 +59,19 @@ ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net46\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.EF6.1.0.106.0\lib\net46\System.Data.SQLite.EF6.dll + True + + + ..\packages\System.Data.SQLite.Linq.1.0.106.0\lib\net46\System.Data.SQLite.Linq.dll + True + @@ -62,8 +80,10 @@ + + @@ -71,6 +91,14 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {0e0eef3e-8f4e-4f23-9d19-479fd8d76c12} + Tango.DAL.Local + + + {38197109-8610-4d3f-92b9-16d48df94d7c} + Tango.DAL.Remote + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging @@ -96,6 +124,8 @@ + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/packages.config b/Software/Visual_Studio/Tango.UnitTesting/packages.config index d3cd9d043..3ffe10b39 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/packages.config +++ b/Software/Visual_Studio/Tango.UnitTesting/packages.config @@ -1,7 +1,12 @@  + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 8b5c7a8bf..2a706378f 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -57,7 +57,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Synchronization.UI", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ShortcutGenerator.CLI", "Utilities\Tango.ShortcutGenerator.CLI\Tango.ShortcutGenerator.CLI.csproj", "{ADDEEDAF-B45C-4681-8FB7-1C0A0DC63B4B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DAL", "Tango.DAL\Tango.DAL.csproj", "{5B78CAD8-1298-46EC-907F-89A73BEEF75E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DAL.Remote", "Tango.DAL.Remote\Tango.DAL.Remote.csproj", "{38197109-8610-4D3F-92B9-16D48DF94D7C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DAL.Local", "Tango.DAL.Local\Tango.DAL.Local.csproj", "{0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -295,18 +297,30 @@ Global {ADDEEDAF-B45C-4681-8FB7-1C0A0DC63B4B}.Release|x64.Build.0 = Release|Any CPU {ADDEEDAF-B45C-4681-8FB7-1C0A0DC63B4B}.Release|x86.ActiveCfg = Release|Any CPU {ADDEEDAF-B45C-4681-8FB7-1C0A0DC63B4B}.Release|x86.Build.0 = Release|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Debug|x64.ActiveCfg = Debug|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Debug|x64.Build.0 = Debug|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Debug|x86.ActiveCfg = Debug|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Debug|x86.Build.0 = Debug|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Release|Any CPU.Build.0 = Release|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Release|x64.ActiveCfg = Release|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Release|x64.Build.0 = Release|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Release|x86.ActiveCfg = Release|Any CPU - {5B78CAD8-1298-46EC-907F-89A73BEEF75E}.Release|x86.Build.0 = Release|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Debug|x64.ActiveCfg = Debug|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Debug|x64.Build.0 = Debug|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Debug|x86.ActiveCfg = Debug|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Debug|x86.Build.0 = Debug|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Release|Any CPU.Build.0 = Release|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Release|x64.ActiveCfg = Release|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Release|x64.Build.0 = Release|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Release|x86.ActiveCfg = Release|Any CPU + {38197109-8610-4D3F-92B9-16D48DF94D7C}.Release|x86.Build.0 = Release|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Debug|x64.ActiveCfg = Debug|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Debug|x64.Build.0 = Debug|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Debug|x86.ActiveCfg = Debug|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Debug|x86.Build.0 = Debug|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Release|Any CPU.Build.0 = Release|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Release|x64.ActiveCfg = Release|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Release|x64.Build.0 = Release|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Release|x86.ActiveCfg = Release|Any CPU + {0E0EEF3E-8F4E-4F23-9D19-479FD8D76C12}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.3.1