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 + 46 files changed, 3604 insertions(+) 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 (limited to 'Software/Visual_Studio/Tango.DAL.Local') 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 -- cgit v1.3.1