??????????????????????????
???????????? ???????[ 2015/7/23 13:42:43 ] ???????????????????
??????????????У???????????????????洢????????洢?????????????в??????仯????????????????????仯?????????????????????????
?????????????洢?????????????
????Presentation??-WebAPI??CNBlogsRefreshTokenProvider
????Application??-?????IRefreshTokenService
????Application??-????RefreshTokenService
????Domain??-??壺RefreshToken
????Repository??-????IRefreshTokenRepository
????Repository??-????FileStorage.RefreshTokenRepository
????????????????????
????Presentation???CNBlogsRefreshTokenProvider -> Application?????IRefreshTokenService + Domain??????RefreshToken??
????Application??????RefreshTokenService -> Repository?????IRefreshTokenRepository + Domain??????RefreshToken??
????Repository??????FileStorage.RefreshTokenRepository -> Domain??????RefreshToken??
???????????????????????????洢????????洢?????????????——???????????洢??????????ORM?????????EF???????IRefreshTokenRepository?????????????????????????1?д???
????????????????????дIRefreshTokenRepository???????Database.RefreshTokenRepository????????????????Щ???????
??????????????洢??FireStorage.RefreshTokenRepository????????????????????????????????????????????
public class RefreshTokenRepository : IRefreshTokenRepository
{
private List<RefreshToken> _refreshTokens;
public RefreshTokenRepository()
{
//...
}
public async Task<RefreshToken> FindById(string Id)
{
return _refreshTokens.Where(x => x.Id == Id).FirstOrDefault();
}
}
???????????Entity FrameworkдDatabase.RrefreshTokenRepository?????????????д?????LINQ???????????????е?????????
public class RefreshTokenRepository : IRefreshTokenRepository
{
public RefreshTokenRepository()
{
}
public async Task<RefreshToken> FindById(string Id)
{
using (var context = new OpenApiDbContext())
{
return context.Set<RefreshToken>()
.Where(x => x.Id == Id).FirstOrDefault();
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11