hytos / ID2.Manager / ID2.Manager.Dapper / Repository / UserRepository.cs @ 0d323d8f
이력 | 보기 | 이력해설 | 다운로드 (792 Bytes)
1 | 8164f84e | yoush97 | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | |||
7 | using ID2.Manager.Data.Models; |
||
8 | |||
9 | namespace ID2.Manager.Dapper.Repository |
||
10 | { |
||
11 | public class UserRepository : BaseRepository |
||
12 | { |
||
13 | public UserRepository(string connectionStr) : base(connectionStr) {} |
||
14 | |||
15 | 709c1971 | yoush97 | public IEnumerable<UserInfo> GetAllUserInfo() |
16 | { |
||
17 | string query = $@"select * from dbo.Users order by [Name]"; |
||
18 | |||
19 | return Query<UserInfo>(query); |
||
20 | } |
||
21 | |||
22 | 8164f84e | yoush97 | public UserInfo GetUserInfo(string userId, string userPW) |
23 | { |
||
24 | string query = $@" |
||
25 | 482f6326 | yoush97 | select * from dbo.Users where ID=@userId and Password=@userPW"; |
26 | 8164f84e | yoush97 | |
27 | return Query<UserInfo>(query, new { userId, userPW }).FirstOrDefault(); |
||
28 | } |
||
29 | } |
||
30 | } |