aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContext.cs
blob: 9f4a9f0f9da289acfad18ccd2e31baef73b8bef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using Tango.Core;

namespace Tango.MachineService.Gateway.DB
{
    public class GatewayDbContext : DbContext
    {
        public GatewayDbContext(DataSource dataSource) : base(dataSource.ToConnection(), true)
        {

        }

        public static GatewayDbContext CreateDefault()
        {
            return new GatewayDbContext(new DataSource()
            {
                Address = GatewayConfig.DB_ADDRESS,
                IntegratedSecurity = false,
                Catalog = GatewayConfig.DB_CATALOG,
                Type = DataSourceType.SQLServer,
                UserName = GatewayConfig.DB_USER_NAME,
                Password = GatewayConfig.DB_PASSWORD
            });
        }

        /// <summary>
        /// Gets or sets the environments.
        /// </summary>
        public DbSet<Environment> Environments
        {
            get; set;
        }
    }
}
s="p">, uint8_t *out); size_t set_valve_state_request__pack_to_buffer (const SetValveStateRequest *message, ProtobufCBuffer *buffer); SetValveStateRequest * set_valve_state_request__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void set_valve_state_request__free_unpacked (SetValveStateRequest *message, ProtobufCAllocator *allocator); /* --- per-message closures --- */ typedef void (*SetValveStateRequest_Closure) (const SetValveStateRequest *message, void *closure_data); /* --- services --- */ /* --- descriptors --- */ extern const ProtobufCMessageDescriptor set_valve_state_request__descriptor; PROTOBUF_C__END_DECLS #endif /* PROTOBUF_C_SetValveStateRequest_2eproto__INCLUDED */