Skip to content
This repository was archived by the owner on Jan 27, 2022. It is now read-only.

Commit 5ac3d37

Browse files
authored
Remove dependency on Winton.DomainModelling.Abstractions. (#19)
1 parent 64b0b4a commit 5ac3d37

39 files changed

Lines changed: 942 additions & 2393 deletions

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ env:
99
matrix:
1010
include:
1111
- os: linux
12-
dist: xenial
13-
dotnet: 2.2
12+
dist: bionic
13+
dotnet: 3.1
1414
- os: osx
15-
osx_image: xcode9 # OSX 10.12
16-
dotnet: 2.2.104
15+
osx_image: xcode11.2
16+
dotnet: 3.1.100
1717
before_install:
1818
- ulimit -n 4096
1919
script:
20-
- dotnet build -c Release
21-
- dotnet test -c Release --no-build --filter Integration!=true
20+
- dotnet test -c Release --filter Integration!=true
2221
notifications:
2322
on_success: always
2423
on_failure: always

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018 Winton
1+
Copyright 2018-2020 Winton
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 119 additions & 302 deletions
Large diffs are not rendered by default.

Winton.DomainModelling.DocumentDb.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@
461461
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
462462
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
463463
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
464+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
464465
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
465466
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
466467
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ environment:
55
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
66
DOCUMENT_DB_URI: https://localhost:8081
77
DOCUMENT_DB_KEY: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
8-
image: Visual Studio 2017
8+
image: Visual Studio 2019
99
configuration:
1010
- Release
1111
skip_tags: true
@@ -14,7 +14,7 @@ install:
1414
- ps: Import-Module "C:\Program Files\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
1515
- ps: Start-CosmosDbEmulator -NoUI -Timeout 0
1616
before_build:
17-
- dotnet tool install -g GitVersion.Tool --version 4.0.1-beta1-58
17+
- dotnet tool install -g GitVersion.Tool
1818
- dotnet gitversion /l console /output buildserver
1919
build_script:
2020
- dotnet build -c Release -p:Version=%GitVersion_NuGetVersion%
@@ -28,7 +28,7 @@ nuget:
2828
deploy:
2929
- provider: NuGet
3030
api_key:
31-
secure: K7GBfAz5cr3lqVzn2+KbM45GA2ZeDjOpgnDU2jpw76PxBL2Qph3OBcfXWuGb+wwD
31+
secure: +CD+4G+gMInD/BjNvO24NW9u1udGdsx0fUi6bh0muNezQ9fP0sHnS1f96f0OXUy6
3232
on:
3333
branch:
3434
- master
Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,35 @@
11
// Copyright (c) Winton. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33

4-
using System;
54
using Newtonsoft.Json;
65

76
namespace Winton.DomainModelling.DocumentDb
87
{
9-
internal sealed class EntityDocument<TEntity, TEntityId, TDto>
10-
where TEntity : Entity<TEntityId>
11-
where TEntityId : IEquatable<TEntityId>
8+
internal sealed class EntityDocument<T>
129
{
1310
[JsonConstructor]
14-
private EntityDocument(TDto entity, string id, string type)
11+
private EntityDocument(string id, string type, T entity)
1512
{
16-
Dto = entity;
13+
Entity = entity;
1714
Id = id;
1815
Type = type;
1916
}
2017

21-
[JsonProperty(PropertyName = "Entity")]
22-
public TDto Dto { get; }
18+
public T Entity { get; }
2319

2420
[JsonProperty(PropertyName = "id")]
2521
public string Id { get; }
2622

2723
public string Type { get; }
2824

29-
public static EntityDocument<TEntity, TEntityId, TDto> Create(TEntity entity, TDto dto)
25+
internal static EntityDocument<T> Create(string id, string type, T entity)
3026
{
31-
return new EntityDocument<TEntity, TEntityId, TDto>(dto, GetDocumentId(entity.Id), GetDocumentType());
27+
return new EntityDocument<T>(CreateId(id, type), type, entity);
3228
}
3329

34-
public static string GetDocumentId(TEntityId id)
30+
internal static string CreateId(string id, string type)
3531
{
36-
return $"{GetDocumentType()}_{JsonConvert.SerializeObject(id)}";
37-
}
38-
39-
public static string GetDocumentType()
40-
{
41-
return typeof(TEntity).Name;
32+
return $"{type}_{id}";
4233
}
4334
}
4435
}

src/Winton.DomainModelling.DocumentDb/EntityExtensions.cs

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

src/Winton.DomainModelling.DocumentDb/EntityFacade.cs

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

src/Winton.DomainModelling.DocumentDb/EntityFacadeFactory.cs

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

0 commit comments

Comments
 (0)