Skip to content

Commit

Permalink
Merge LinkIt.Conventions into LinkIt
Browse files Browse the repository at this point in the history
Since LinkIt.Conventions is always packaged with LinkIt,
might as well merge them; it makes NuGet generation easier.
  • Loading branch information
laurentlbm-rc committed Jan 9, 2018
1 parent 16d58fc commit 00bef1f
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 51 deletions.
1 change: 0 additions & 1 deletion LinkIt.Conventions.Tests/LinkIt.Conventions.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LinkIt.Conventions\LinkIt.Conventions.csproj" />
<ProjectReference Include="..\LinkIt.TestHelpers\LinkIt.TestHelpers.csproj" />
</ItemGroup>

Expand Down
12 changes: 0 additions & 12 deletions LinkIt.Conventions/LinkIt.Conventions.csproj

This file was deleted.

1 change: 0 additions & 1 deletion LinkIt.Samples/LinkIt.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


<ItemGroup>
<ProjectReference Include="..\LinkIt.Conventions\LinkIt.Conventions.csproj" />
<ProjectReference Include="..\LinkIt\LinkIt.csproj" />
</ItemGroup>

Expand Down
16 changes: 1 addition & 15 deletions LinkIt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkIt", "LinkIt\LinkIt.csp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkIt.Tests", "LinkIt.Tests\LinkIt.Tests.csproj", "{A126FAF0-B945-42F1-9267-766E67C92825}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkIt.Conventions", "LinkIt.Conventions\LinkIt.Conventions.csproj", "{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkIt.Conventions.Tests", "LinkIt.Conventions.Tests\LinkIt.Conventions.Tests.csproj", "{7A97AB8A-D206-4F8F-8FE9-F4FE87C7BD07}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkIt.Samples", "LinkIt.Samples\LinkIt.Samples.csproj", "{6AACAD49-8DDE-44F5-88F8-73E13684B285}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinkIt.TestHelpers", "LinkIt.TestHelpers\LinkIt.TestHelpers.csproj", "{542CCDDC-59EF-45C7-973B-FDD4A1F30A7E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkIt.TestHelpers", "LinkIt.TestHelpers\LinkIt.TestHelpers.csproj", "{542CCDDC-59EF-45C7-973B-FDD4A1F30A7E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -47,18 +45,6 @@ Global
{A126FAF0-B945-42F1-9267-766E67C92825}.Release|x64.Build.0 = Release|Any CPU
{A126FAF0-B945-42F1-9267-766E67C92825}.Release|x86.ActiveCfg = Release|Any CPU
{A126FAF0-B945-42F1-9267-766E67C92825}.Release|x86.Build.0 = Release|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Debug|x64.ActiveCfg = Debug|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Debug|x64.Build.0 = Debug|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Debug|x86.Build.0 = Debug|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Release|Any CPU.Build.0 = Release|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Release|x64.ActiveCfg = Release|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Release|x64.Build.0 = Release|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Release|x86.ActiveCfg = Release|Any CPU
{7D6C1E09-BDF9-45BB-A7E6-6E110AFC0250}.Release|x86.Build.0 = Release|Any CPU
{7A97AB8A-D206-4F8F-8FE9-F4FE87C7BD07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A97AB8A-D206-4F8F-8FE9-F4FE87C7BD07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A97AB8A-D206-4F8F-8FE9-F4FE87C7BD07}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void ApplyConvention(ConventionMatch match)
string.Format(
"The convention \"{0}\" failed for Apply. Link target id: {1}, linked source model property: {2}",
match.Convention.Name,
match.LinkTargetProperty.GetFullName(),
PropertyInfoExtensions.GetFullName(match.LinkTargetProperty),
match.LinkedSourceModelProperty.Name
),
ex.InnerException
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public bool DoesApply(PropertyInfo linkedSourceModelProperty, PropertyInfo linkT
var sourceListItemType = linkedSourceModelProperty.PropertyType.GenericTypeArguments.Single();
var linkTargetListItemType = linkTargetProperty.PropertyType.GenericTypeArguments.Single();

if (!linkTargetListItemType.DoesImplementILinkedSourceOnceAndOnlyOnce()) return false;
if (!LinkedSourceTypeExtensions.DoesImplementILinkedSourceOnceAndOnlyOnce(linkTargetListItemType)) return false;

if (linkTargetListItemType.GetLinkedSourceModelType() != sourceListItemType) return false;
if (LinkedSourceTypeExtensions.GetLinkedSourceModelType(linkTargetListItemType) != sourceListItemType) return false;

return true;
}
Expand All @@ -39,7 +39,7 @@ public void Apply<TLinkedSource, TLinkTargetProperty, TLinkedSourceModelProperty
PropertyInfo linkedSourceModelProperty,
PropertyInfo linkTargetProperty)
{
loadLinkProtocolForLinkedSourceBuilder.PolymorphicLoadLinkForList(
loadLinkProtocolForLinkedSourceBuilder.PolymorphicLoadLinkForList<TLinkTargetProperty, TLinkedSourceModelProperty, bool>(
getLinkedSourceModelProperty,
getLinkTargetProperty,
link => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class LoadLinkSingleValueNestedLinkedSourceFromModelWhenNameMatches : ISi
public bool DoesApply(PropertyInfo linkedSourceModelProperty, PropertyInfo linkTargetProperty)
{
if (linkTargetProperty.Name != linkedSourceModelProperty.Name) return false;
if (!linkTargetProperty.PropertyType.DoesImplementILinkedSourceOnceAndOnlyOnce()) return false;
if (linkTargetProperty.PropertyType.GetLinkedSourceModelType() != linkedSourceModelProperty.PropertyType) return false;
if (!LinkedSourceTypeExtensions.DoesImplementILinkedSourceOnceAndOnlyOnce(linkTargetProperty.PropertyType)) return false;
if (LinkedSourceTypeExtensions.GetLinkedSourceModelType(linkTargetProperty.PropertyType) != linkedSourceModelProperty.PropertyType) return false;

return true;
}
Expand All @@ -32,7 +32,7 @@ public void Apply<TLinkedSource, TLinkTargetProperty, TLinkedSourceModelProperty
PropertyInfo linkedSourceModelProperty,
PropertyInfo linkTargetProperty)
{
loadLinkProtocolForLinkedSourceBuilder.PolymorphicLoadLink(
loadLinkProtocolForLinkedSourceBuilder.PolymorphicLoadLink<TLinkTargetProperty, TLinkedSourceModelProperty, bool>(
getLinkedSourceModelProperty,
getLinkTargetProperty,
link => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private bool DoesConventionApply(ConventionMatch match)
string.Format(
"The convention \"{0}\" failed for DoesApply. Link target id: {1}, linked source model property: {2}",
match.Convention.Name,
match.LinkTargetProperty.GetFullName(),
PropertyInfoExtensions.GetFullName(match.LinkTargetProperty),
match.LinkedSourceModelProperty.Name
),
ex
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public static void ApplyConventions(

private static void EnsureConventionNamesAreUnique(List<ILoadLinkExpressionConvention> conventions)
{
var notUniqueConventionNames = conventions.GetNotUniqueKey(convention => convention.Name);
var notUniqueConventionNames = EnumerableExtensions.GetNotUniqueKey(conventions, convention => convention.Name);

if (notUniqueConventionNames.Any())
if (notUniqueConventionNames.Any<string>())
throw new ArgumentException(
string.Format(
"Cannot have many conventions with the same name: {0}",
Expand Down
23 changes: 11 additions & 12 deletions LinkIt/LinkIt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Title>LinkIt.AutoMapperExtensions</Title>
<Description>LinkIt is an object-oriented data integration library that make it easy to load different kinds of objects and link them together.
<Title>LinkIt</Title>
<Description>LinkIt is an object-oriented data integration library that make it easy to load different kinds of objects and link them together.

LinkIt is not an object-relational mapping framework. It can be used for orchestrating the loading of objects and for linking the loaded objects togheter, not for defining how the objects are loaded. LinkIt is intended to be used in a variety of context such as data APIs, ETL processes, CQRS event handlers, web crawlers, etc.
LinkIt is not an object-relational mapping framework. It can be used for orchestrating the loading of objects and for linking the loaded objects togheter, not for defining how the objects are loaded. LinkIt is intended to be used in a variety of context such as data APIs, ETL processes, CQRS event handlers, web crawlers, etc.

Features
- Minimize coding effort by
- leveraging reuse and composition
- Data source independant
- Avoid the Select N + 1 problem
- Built-in support for references between complex types
- Support polymorphism out of the box
- Favor convention over configuration
Features
- Minimize coding effort by leveraging reuse and composition
- Data source independant
- Avoid the Select N + 1 problem
- Built-in support for references between complex types
- Support polymorphism out of the box
- Favor convention over configuration
- Perform complex projections easily with LinkIt AutoMapper Extensions</Description>
<Version>1.1.0</Version>
<Authors>Stéphane Leblanc, Laurent le Beau-Martin</Authors>
<Company>Radio-Canada/CBC</Company>
<Copyright>Copyright (c) 2015-2017 Radio-Canada/CBC</Copyright>
<Copyright>Copyright (c) 2015-2018 Radio-Canada/CBC</Copyright>
<PackageIconUrl>https://raw.githubusercontent.com/cbcrc/LinkIt/master/icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/cbcrc/LinkIt</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/cbcrc/LinkIt/master/LICENSE.txt</PackageLicenseUrl>
Expand Down

0 comments on commit 00bef1f

Please sign in to comment.