mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-05-09 23:28:02 +08:00
check issue #15
This commit is contained in:
parent
e430b2716d
commit
56a0581fe0
@ -1,6 +1,7 @@
|
|||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Repository
|
namespace OpenAuth.Repository
|
||||||
@ -35,20 +36,16 @@ namespace OpenAuth.Repository
|
|||||||
/// <param name="idMaps">关联的<firstId, secondId>数组</param>
|
/// <param name="idMaps">关联的<firstId, secondId>数组</param>
|
||||||
public void AddRelevance(string key, ILookup<Guid, Guid> idMaps)
|
public void AddRelevance(string key, ILookup<Guid, Guid> idMaps)
|
||||||
{
|
{
|
||||||
foreach (var sameVals in idMaps)
|
DeleteBy(key, idMaps);
|
||||||
{
|
BatchAdd((from sameVals in idMaps
|
||||||
foreach (var value in sameVals)
|
from value in sameVals
|
||||||
{
|
select new Relevance
|
||||||
Add(new Relevance
|
|
||||||
{
|
{
|
||||||
Key = key,
|
Key = key,
|
||||||
FirstId = sameVals.Key,
|
FirstId = sameVals.Key,
|
||||||
SecondId = value,
|
SecondId = value,
|
||||||
OperateTime = DateTime.Now
|
OperateTime = DateTime.Now
|
||||||
});
|
}).ToArray());
|
||||||
}
|
|
||||||
}
|
|
||||||
Save();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user