Skip to content

Commit 45e3374

Browse files
committed
Fixes for design provider and tests
Ported to RC3. Everything looks good except that some Roslyn-related issue is plaguing the tests.
1 parent f724b3a commit 45e3374

39 files changed

Lines changed: 444 additions & 555 deletions

src/Npgsql.EntityFrameworkCore.PostgreSQL.Design/Npgsql.EntityFrameworkCore.PostgreSQL.Design.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
<Link>Properties\CommonAssemblyInfo.cs</Link>
6262
<SubType>Code</SubType>
6363
</Compile>
64-
<Compile Include="Utilities\CodeAnnotations.cs" />
6564
<Compile Include="Utilities\LoggingExtensions.cs" />
6665
<Compile Include="Utilities\SharedTypeExtensions.cs" />
6766
</ItemGroup>
@@ -82,4 +81,4 @@
8281
<Target Name="AfterBuild">
8382
</Target>
8483
-->
85-
</Project>
84+
</Project>

src/Npgsql.EntityFrameworkCore.PostgreSQL.Design/Npgsql.EntityFrameworkCore.PostgreSQL.Design.project.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"dependencies" : {
3-
"Microsoft.EntityFrameworkCore": "1.0.0-rc2-*",
4-
"Microsoft.EntityFrameworkCore.Relational": "1.0.0-rc2-*",
5-
"Microsoft.EntityFrameworkCore.Relational.Design": "1.0.0-rc2-*",
6-
"Microsoft.Extensions.DependencyInjection": "1.0.0-rc2-*",
7-
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc2-*",
3+
"Microsoft.EntityFrameworkCore": "1.0.0-*",
4+
"Microsoft.EntityFrameworkCore.Relational": "1.0.0-*",
5+
"Microsoft.EntityFrameworkCore.Relational.Design": "1.0.0-*",
6+
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
7+
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*",
88
"Npgsql": "3.1.4"
99
},
1010
"frameworks": {

src/Npgsql.EntityFrameworkCore.PostgreSQL.Design/NpgsqlDesignTimeServices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
using Microsoft.EntityFrameworkCore.Storage.Internal;
2828
using Microsoft.Extensions.DependencyInjection;
2929

30-
namespace Microsoft.EntityFrameworkCore.Scaffolding
30+
namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal
3131
{
3232
public class NpgsqlDesignTimeServices
3333
{

src/Npgsql.EntityFrameworkCore.PostgreSQL.Design/NpgsqlScaffoldingModelFactory.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,28 @@
2222
#endregion
2323

2424
using System;
25-
using System.Collections.Generic;
2625
using System.Linq;
2726
using JetBrains.Annotations;
28-
using Microsoft.EntityFrameworkCore;
29-
using Microsoft.EntityFrameworkCore.Internal;
3027
using Microsoft.EntityFrameworkCore.Metadata;
3128
using Microsoft.EntityFrameworkCore.Metadata.Builders;
32-
using Microsoft.EntityFrameworkCore.Metadata.Internal;
3329
using Microsoft.EntityFrameworkCore.Scaffolding.Metadata;
3430
using Microsoft.EntityFrameworkCore.Storage;
3531
using Microsoft.Extensions.Logging;
3632

37-
namespace Microsoft.EntityFrameworkCore.Scaffolding
33+
namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal
3834
{
3935
public class NpgsqlScaffoldingModelFactory : RelationalScaffoldingModelFactory
4036
{
4137
public NpgsqlScaffoldingModelFactory(
4238
[NotNull] ILoggerFactory loggerFactory,
4339
[NotNull] IRelationalTypeMapper typeMapper,
44-
[NotNull] IDatabaseModelFactory databaseModelFactory)
45-
: base(loggerFactory, typeMapper, databaseModelFactory)
40+
[NotNull] IDatabaseModelFactory databaseModelFactory,
41+
[NotNull] CandidateNamingService candidateNamingService)
42+
: base(loggerFactory, typeMapper, databaseModelFactory, candidateNamingService)
4643
{
4744
}
4845

49-
public override IModel Create(string connectionString, TableSelectionSet tableSelectionSet)
46+
public override IModel Create(string connectionString, [CanBeNull] TableSelectionSet tableSelectionSet)
5047
{
5148
var model = base.Create(connectionString, tableSelectionSet);
5249
model.Scaffolding().UseProviderMethodName = nameof(NpgsqlDbContextOptionsExtensions.UseNpgsql);

src/Npgsql.EntityFrameworkCore.PostgreSQL.Design/Utilities/CodeAnnotations.cs

Lines changed: 0 additions & 253 deletions
This file was deleted.

test/Npgsql.EntityFrameworkCore.PostgreSQL.Design.FunctionalTests/Npgsql.EntityFrameworkCore.PostgreSQL.Design.FunctionalTests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@
6767
</ItemGroup>
6868
<ItemGroup>
6969
<None Include="app.config" />
70-
<None Include="ReverseEngineering\Expected\ColumnsWithSequences\IDNonSerialSequence.expected">
70+
<None Include="ReverseEngineering\Expected\ColumnsWithSequences\IdNonSerialSequence.expected">
7171
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7272
</None>
73-
<None Include="ReverseEngineering\Expected\ColumnsWithSequences\IDSerialSequence.expected">
73+
<None Include="ReverseEngineering\Expected\ColumnsWithSequences\IdSerialSequence.expected">
7474
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7575
</None>
7676
<None Include="ReverseEngineering\Expected\AllFluentApi\AllDataTypes.expected">
@@ -188,4 +188,4 @@
188188
<Target Name="AfterBuild">
189189
</Target>
190190
-->
191-
</Project>
191+
</Project>

test/Npgsql.EntityFrameworkCore.PostgreSQL.Design.FunctionalTests/ReverseEngineering/Expected/AllFluentApi/AllDataTypes.expected

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ namespace E2ETest.Namespace
55
{
66
public partial class AllDataTypes
77
{
8-
public int AllDataTypesID { get; set; }
9-
public short smallintColumn { get; set; }
10-
public int intColumn { get; set; }
11-
public long bigintColumn { get; set; }
12-
public float? realColumn { get; set; }
13-
public double doubleColumn { get; set; }
14-
public decimal decimalColumn { get; set; }
15-
public decimal numericColumn { get; set; }
16-
public decimal moneyColumn { get; set; }
17-
public string charColumn { get; set; }
18-
public string textColumn { get; set; }
19-
public string varcharColumn { get; set; }
20-
public DateTime dateColumn { get; set; }
21-
public DateTime? timestampColumn { get; set; }
22-
public DateTime? timestampTzColumn { get; set; }
23-
public TimeSpan? timeColumn { get; set; }
24-
public byte[] byteaColumn { get; set; }
25-
public bool boolColumn { get; set; }
26-
public Guid? uuidColumn { get; set; }
8+
public int AllDataTypesId { get; set; }
9+
public short SmallintColumn { get; set; }
10+
public int IntColumn { get; set; }
11+
public long BigintColumn { get; set; }
12+
public float? RealColumn { get; set; }
13+
public double DoubleColumn { get; set; }
14+
public decimal DecimalColumn { get; set; }
15+
public decimal NumericColumn { get; set; }
16+
public decimal MoneyColumn { get; set; }
17+
public string CharColumn { get; set; }
18+
public string TextColumn { get; set; }
19+
public string VarcharColumn { get; set; }
20+
public DateTime DateColumn { get; set; }
21+
public DateTime? TimestampColumn { get; set; }
22+
public DateTime? TimestampTzColumn { get; set; }
23+
public TimeSpan? TimeColumn { get; set; }
24+
public byte[] ByteaColumn { get; set; }
25+
public bool BoolColumn { get; set; }
26+
public Guid? UuidColumn { get; set; }
2727
}
2828
}

0 commit comments

Comments
 (0)