Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Add double type mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed Oct 31, 2018
1 parent f87cce5 commit fa2c413
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/Provider35/EntityFramework.SqlServerCompact35.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@
<Compile Include="..\Provider40\Storage\Internal\SqlCeDecimalTypeMapping.cs">
<Link>Storage\Internal\SqlCeDecimalTypeMapping.cs</Link>
</Compile>
<Compile Include="..\Provider40\Storage\Internal\SqlCeDoubleTypeMapping.cs">
<Link>Storage\Internal\SqlCeDoubleTypeMapping.cs</Link>
</Compile>
<Compile Include="..\Provider40\Storage\Internal\SqlCeFloatTypeMapping.cs">
<Link>Storage\Internal\SqlCeFloatTypeMapping.cs</Link>
</Compile>
Expand Down
1 change: 1 addition & 0 deletions src/Provider40/EntityFramework.SqlServerCompact40.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<Compile Include="MetaData\Conventions\Internal\SqlCeConventionSetBuilder.cs" />
<Compile Include="Storage\Internal\SqlCeDateTimeTypeMapping.cs" />
<Compile Include="Storage\Internal\SqlCeDecimalTypeMapping.cs" />
<Compile Include="Storage\Internal\SqlCeDoubleTypeMapping.cs" />
<Compile Include="Storage\Internal\SqlCeFloatTypeMapping.cs" />
<Compile Include="Storage\Internal\SqlCeLongTypeMapping.cs" />
<Compile Include="Storage\Internal\SqlCeShortTypeMapping.cs" />
Expand Down
51 changes: 51 additions & 0 deletions src/Provider40/Storage/Internal/SqlCeDoubleTypeMapping.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.Data;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Storage;

namespace EFCore.SqlCe.Storage.Internal
{
/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public class SqlCeDoubleTypeMapping : DoubleTypeMapping
{
/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public SqlCeDoubleTypeMapping(
[NotNull] string storeType,
DbType? dbType = null)
: base(storeType, dbType)
{
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
protected SqlCeDoubleTypeMapping(RelationalTypeMappingParameters parameters)
: base(parameters)
{
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new SqlCeDoubleTypeMapping(parameters);

//TODO Investigate

//Test 'Microsoft.EntityFrameworkCore.Query.SimpleQuerySqlCeTest.Average_over_nested_subquery_is_client_eval

///// <summary>
///// This API supports the Entity Framework Core infrastructure and is not intended to be used
///// directly from your code. This API may change or be removed in future releases.
///// </summary>
//protected override string GenerateNonNullSqlLiteral(object value)
// => $"CAST({base.GenerateNonNullSqlLiteral(value)} AS {StoreType})";
}
}
2 changes: 1 addition & 1 deletion src/Provider40/Storage/Internal/SqlCeTypeMapppingSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private readonly SqlCeDateTimeTypeMapping _datetime
= new SqlCeDateTimeTypeMapping("datetime", dbType: DbType.DateTime);

private readonly DoubleTypeMapping _double
= new DoubleTypeMapping("float", DbType.Double);
= new SqlCeDoubleTypeMapping("float", DbType.Double);

private readonly GuidTypeMapping _uniqueidentifier
= new GuidTypeMapping("uniqueidentifier", DbType.Guid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ public override Task OrderBy_coalesce_take_distinct(bool isAsync)
return base.OrderBy_coalesce_take_distinct(isAsync);
}

//TODO ErikEJ Investigate - https://github.com/aspnet/EntityFrameworkCore/issues/13786
[Theory(Skip = "Investigate")]
public override Task Average_over_nested_subquery_is_client_eval(bool isAsync)
{
return base.Average_over_nested_subquery_is_client_eval(isAsync);
}

[Theory(Skip = "SQLCE limitation")]
public override async Task Select_bool_closure_with_order_by_property_with_cast_to_nullable(bool isAsync)
{
Expand Down

0 comments on commit fa2c413

Please sign in to comment.