Skip to content

Commit 1884a0d

Browse files
NikTJ777NTS3Weston Weemseresende-nuodbNik Trevallyn-Jones
authored
Ntj/version4 test (#45)
* hanges made to update dotNET driver for latest MS APIs and NuoDB 5+ * Initialworks * fixing small int mapping * More changes * More test completion and fixes * Tests, function mapping, general fixes. * Adding test to demonstrate DateTimeKind thing * Migration features, tests, minor fixes to date criteria with more to come * Latest updates, and migration tests * Excluding some classes from coverage * fixed transaction started, and db model factory issues for tests * Date Functions, Unit tests, Coverage Improvements * Added reoptimize always for parameterized limit / offset statements * Better migration support, correct creation of autoincrement fields * net8.0 upgrade, efcore8.x and misc little quality of life improvements * Add CircleCI configuration (#42) Runs build and test on linux Only runs build on Windows since it needs a live NuoDB database to test. Collects code-coverage and test results. * Update license and readme files * Bump to version 4.0.0 on project file * Delete Backup dir * Remove Travis CI file * Fixed insert error with unexpected result set, simplified append insert * Allow custom params for nuodb test database * Fix CircleCI linux testing failures jetbrains.dotcover.globaltool has been deprecated. Now using JetBrains.dotCover.CommandLineTools. --------- Co-authored-by: NTS3 <NTS3@3ds.com> Co-authored-by: Weston Weems <weston.weems@3ds.com> Co-authored-by: Eusebio@nuodb <58469485+eresende-nuodb@users.noreply.github.com> Co-authored-by: Eusebio Resende <ere3@3ds.com> Co-authored-by: Nik Trevallyn-Jones <Nicholas.TREAVLLYN-JONES@3ds.com>
1 parent 756429c commit 1884a0d

File tree

89 files changed

+7546
-5594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+7546
-5594
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run:
2525
name: Install JetBrains dotCover CLI and Logger package
2626
command: |
27-
dotnet tool install --global JetBrains.dotCover.GlobalTool
27+
dotnet tool install --global JetBrains.dotCover.CommandLineTools
2828
dotnet add NuoDb.EntityFrameworkCore.Tests/NuoDb.EntityFrameworkCore.Tests.csproj package JunitXml.TestLogger
2929
- run:
3030
name: Restore packages

.travis.yml

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

ConsoleEFCoreTest/ConsoleEFCoreTest.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
@@ -13,10 +13,10 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.29" />
17-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
18-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
19-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
17+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
18+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.1" />
19+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
2020
</ItemGroup>
2121

2222
<ItemGroup>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using ConsoleEFCoreTest.Entities.Commerce;
7+
using Microsoft.EntityFrameworkCore;
8+
9+
namespace ConsoleEFCoreTest.Contexts
10+
{
11+
public class CommerceContext: DbContext
12+
{
13+
public DbSet<Product> Products { get; set; }
14+
public DbSet<OrderItem> OrderItems { get; set; }
15+
public DbSet<Order> Orders { get; set; }
16+
public DbSet<User> Users { get; set; }
17+
18+
protected override void OnConfiguring(DbContextOptionsBuilder options)
19+
{
20+
options.UseNuoDb("Server=localhost;Database=demo;User=dba;Password=dba;schema=USER");
21+
}
22+
23+
protected override void OnModelCreating(ModelBuilder builder)
24+
{
25+
builder.Entity<Order>()
26+
.HasOne<User>(x => x.User)
27+
.WithMany(x => x.Orders);
28+
29+
builder.Entity<Order>()
30+
.HasMany<OrderItem>(x => x.OrderItems)
31+
.WithOne(x=>x.Order);
32+
33+
builder.Entity<OrderItem>().HasOne<Product>(x => x.Product);
34+
}
35+
}
36+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace ConsoleEFCoreTest.Entities.Commerce
8+
{
9+
public class Order
10+
{
11+
public int Id { get; set; }
12+
public string Name { get; set; }
13+
public string Description { get; set; }
14+
public List<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
15+
16+
public int UserId { get; set; }
17+
public User User { get; set; }
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace ConsoleEFCoreTest.Entities.Commerce
8+
{
9+
public class OrderItem
10+
{
11+
public int Id { get; set; }
12+
public string Description { get; set; }
13+
public int Quantity { get; set; }
14+
public decimal Price { get; set; } = decimal.Zero;
15+
public Product Product { get; set; }
16+
public int OrderId { get; set; }
17+
public Order Order { get; set; }
18+
}
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace ConsoleEFCoreTest.Entities.Commerce
8+
{
9+
public class Product
10+
{
11+
public int Id { get; set; }
12+
public string Name { get; set; }
13+
public string Description { get; set; }
14+
public string Category { get; set; }
15+
}
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace ConsoleEFCoreTest.Entities.Commerce
8+
{
9+
public class User
10+
{
11+
public int Id { get; set; }
12+
public string Name { get; set; }
13+
public string Email { get; set; }
14+
15+
public List<Order> Orders { get; set; }
16+
}
17+
}

ConsoleEFCoreTest/Migrations/20241230175718_initial.Designer.cs

Lines changed: 160 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)