Skip to content

Commit 9495082

Browse files
authored
add-many-SetDependency (#556)
1 parent fc57550 commit 9495082

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

src/Framework.SecuritySystem/DependencyInjection/DomainSecurityServiceBuilder/DomainSecurityServiceBuilder.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,22 @@ public IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>()
119119

120120
public IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>(Expression<Func<TDomainObject, TSource>> relativeDomainPath)
121121
where TSource : class
122+
{
123+
return this.SetDependency(new SingleRelativeDomainPathInfo<TDomainObject, TSource>(relativeDomainPath));
124+
}
125+
126+
public IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>(Expression<Func<TDomainObject, IEnumerable<TSource>>> relativeDomainPath)
127+
where TSource : class
128+
{
129+
return this.SetDependency(new ManyRelativeDomainPathInfo<TDomainObject, TSource>(relativeDomainPath));
130+
}
131+
132+
private IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>(IRelativeDomainPathInfo<TDomainObject, TSource> relativeDomainPathInfo)
133+
where TSource : class
122134
{
123135
this.SetDependency<TSource>();
124136

125-
this.relativePathData =
126-
(typeof(IRelativeDomainPathInfo<TDomainObject, TSource>),
127-
new SingleRelativeDomainPathInfo<TDomainObject, TSource>(relativeDomainPath));
137+
this.relativePathData = (typeof(IRelativeDomainPathInfo<TDomainObject, TSource>), relativeDomainPathInfo);
128138

129139
return this;
130140
}

src/Framework.SecuritySystem/DependencyInjection/DomainSecurityServiceBuilder/IDomainSecurityServiceBuilder.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>()
3131
IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>(Expression<Func<TDomainObject, TSource>> relativeDomainPath)
3232
where TSource : class;
3333

34+
/// <summary>
35+
/// RelativeDomainPathInfo will be automatically registered
36+
/// </summary>
37+
/// <typeparam name="TSource"></typeparam>
38+
/// <param name="relativeDomainPath"></param>
39+
/// <returns></returns>
40+
IDomainSecurityServiceBuilder<TDomainObject> SetDependency<TSource>(Expression<Func<TDomainObject, IEnumerable<TSource>>> relativeDomainPath)
41+
where TSource : class;
42+
3443
/// <summary>
3544
/// For projection
3645
/// </summary>

src/__SolutionItems/CommonAssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[assembly: AssemblyCompany("Luxoft")]
55
[assembly: AssemblyCopyright("Copyright © Luxoft 2009-2025")]
66

7-
[assembly: AssemblyVersion("23.2.7.0")]
8-
[assembly: AssemblyFileVersion("23.2.7.0")]
9-
[assembly: AssemblyInformationalVersion("23.2.7.0")]
7+
[assembly: AssemblyVersion("23.2.8.0")]
8+
[assembly: AssemblyFileVersion("23.2.8.0")]
9+
[assembly: AssemblyInformationalVersion("23.2.8.0")]
1010

1111
#if DEBUG
1212
[assembly: AssemblyConfiguration("Debug")]

0 commit comments

Comments
 (0)