forked from dotnet/efcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLiteTypeMapper.cs
More file actions
26 lines (23 loc) · 967 Bytes
/
Copy pathSQLiteTypeMapper.cs
File metadata and controls
26 lines (23 loc) · 967 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
25
26
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using Microsoft.Data.Entity.Relational.Model;
using Microsoft.Data.SQLite.Utilities;
namespace Microsoft.Data.Entity.SQLite
{
public class SQLiteTypeMapper : RelationalTypeMapper
{
public override RelationalTypeMapping GetTypeMapping(
string specifiedType, string storageName, Type propertyType, bool isKey, bool isConcurrencyToken)
{
var map = SQLiteTypeMap.FromClrType(propertyType);
if (specifiedType != null)
{
map = SQLiteTypeMap.FromDeclaredType(specifiedType, map.SQLiteType);
}
// TODO: Leverage base implementation more
return new RelationalTypeMapping(map.DeclaredTypes.First(), map.DbType);
}
}
}