diff options
Diffstat (limited to 'Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCContext.cs')
| -rw-r--r-- | Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCContext.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCContext.cs b/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCContext.cs new file mode 100644 index 000000000..5770bf1d0 --- /dev/null +++ b/Software/Visual_Studio/TCC/Tango.TCC.BL/Entities/TCCContext.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.TCC.BL.Entities +{ + public class TCCContext : DbContext + { + private DataSource _dataSource; + + /// <summary> + /// Initializes a new instance of the <see cref="TCCContext"/> class. + /// </summary> + public TCCContext() + { + + } + + /// <summary> + /// Initializes a new instance of the <see cref="TCCContext"/> class. + /// </summary> + /// <param name="dataSource">The data source.</param> + public TCCContext(DataSource dataSource) : base(dataSource.ToConnection(), true) + { + _dataSource = dataSource; + Database.SetInitializer<TCCContext>(null); + Configuration.LazyLoadingEnabled = false; + } + + /// <summary> + /// Gets or sets the devices. + /// </summary> + public DbSet<Device> Devices + { + get; set; + } + } +} |
