-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathEventDb.cs
More file actions
24 lines (22 loc) · 808 Bytes
/
EventDb.cs
File metadata and controls
24 lines (22 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using LinqToDB;
using LinqToDB.Data;
using Vertex.Storage.Linq2db.Entities;
namespace Vertex.Storage.Linq2db.Db
{
public class EventDb : DataConnection
{
public EventDb(string name)
: base(name)
{
LinqToDB.Mapping.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) =>
{
entityDescriptor.TableName = entityDescriptor.TableName.ToLower();
foreach (var entityDescriptorColumn in entityDescriptor.Columns)
{
entityDescriptorColumn.ColumnName = entityDescriptorColumn.ColumnName.ToLower();
}
};
}
public ITable<EventEntity<TPrimaryKey>> Table<TPrimaryKey>() => this.GetTable<EventEntity<TPrimaryKey>>();
}
}