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