Skip to content

Commit

Permalink
Merge pull request #67 from marcwittke/hotfix/buildfix
Browse files Browse the repository at this point in the history
Hotfix/buildfix
  • Loading branch information
marcwittke committed Jun 24, 2019
2 parents 71b884d + 1bbf76a commit e1707d0
Show file tree
Hide file tree
Showing 21 changed files with 207 additions and 143 deletions.
2 changes: 1 addition & 1 deletion src/abstractions/Backend.Fx/Backend.Fx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>Abstractions of Backend.Fx and generic base implementations.</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>Integration of Backend.Fx abstraction and implementation into ASP.NET Core MVC applications</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>Integration of Backend.Fx abstraction and implementation into ASP.NET Core applications</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>Integration of Backend.Fx abstraction and implementation into .NET Core applications</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>Persistence implementation for Backend.Fx using Entity Framework Core 2</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>In memory dictionary based implementation of Backend.Fx persistence abstraction</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>NLog logging implementation for Backend.Fx</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>An event bus implementation based on RabbitMQ</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Copyright>All rights reserved. Distributed under the terms of the MIT License.</Copyright>
<Description>Bootstrapping for Backend.Fx using Simple Injector 4</Description>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageLicense>MIT</PackageLicense>
<PackageProjectUrl>https://github.com/marcwittke/Backend.Fx</PackageProjectUrl>
<Product>Backend.Fx</Product>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="xunit" Version="2.4.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public Blog(int id, string name) : base(id)

public ISet<Post> Posts { get; } = new HashSet<Post>();

public Post AddPost(IEntityIdGenerator idGenerator, string name)
public Post AddPost(IEntityIdGenerator idGenerator, string name, bool isPublic=false)
{
var post = new Post(idGenerator.NextId(), this, name);
var post = new Post(idGenerator.NextId(), this, name, isPublic);
Posts.Add(post);
return post;
}
Expand Down
20 changes: 18 additions & 2 deletions tests/Backend.Fx.EfCorePersistence.Tests/DummyImpl/Domain/Post.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Backend.Fx.BuildingBlocks;
using System.Collections.Generic;
using Backend.Fx.BuildingBlocks;
using JetBrains.Annotations;

namespace Backend.Fx.EfCorePersistence.Tests.DummyImpl.Domain
Expand All @@ -8,20 +9,35 @@ public class Post : Entity
[UsedImplicitly]
private Post() { }

public Post(int id, Blog blog, string name) : base(id)
public Post(int id, Blog blog, string name, bool isPublic=false) : base(id)
{
Blog = blog;
BlogId = blog.Id;
Name = name;
TargetAudience = new TargetAudience {IsPublic = isPublic, Culture = "fr-FR"};
}

public int BlogId { get; [UsedImplicitly] private set; }
public Blog Blog { get; [UsedImplicitly] private set; }
public string Name { get; private set; }

public TargetAudience TargetAudience { get; set; }

public void SetName(string name)
{
Name = name;
}
}

public class TargetAudience : ValueObject
{
public string Culture { get; set; }

public bool IsPublic { get; set; }
protected override IEnumerable<object> GetEqualityComponents()
{
yield return Culture;
yield return IsPublic;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ namespace Backend.Fx.EfCorePersistence.Tests.DummyImpl.Persistence
public class BlogMapping : AggregateMapping<Blog>
{
public override void ApplyEfMapping(ModelBuilder modelBuilder)
{ }
{
modelBuilder.Entity<Post>().OwnsOne(p => p.TargetAudience);
}

public override IEnumerable<Expression<Func<Blog, object>>> IncludeDefinitions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Infrastructure;

namespace Backend.Fx.EfCorePersistence.Tests.DummyImpl.Persistence
{
[UsedImplicitly, Obsolete("Only for migration support at design time")]
public class TestDbContextFactory : IDbContextFactory<TestDbContext>
public class TestDbContextFactory : IDesignTimeDbContextFactory<TestDbContext>
{
public TestDbContext Create(DbContextFactoryOptions options)
public TestDbContext CreateDbContext(string[] args)
{
return new TestDbContext(new DbContextOptionsBuilder<TestDbContext>().UseSqlite("DataSource=:memory:").Options);
}
Expand Down

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1707d0

Please sign in to comment.