forked from WeihanLi/DesignPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserRepo.cs
More file actions
39 lines (33 loc) · 822 Bytes
/
UserRepo.cs
File metadata and controls
39 lines (33 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
namespace AbstractFactoryPattern
{
public interface IUserRepo
{
void Insert(User user);
User GetUser(int userId);
}
internal class SqlServerUserRepo : IUserRepo
{
public void Insert(User user)
{
Console.WriteLine("insert user in SqlServer");
}
public User GetUser(int userId)
{
Console.WriteLine("Get user from SqlServer by userId");
return null;
}
}
internal class AccessUserRepo : IUserRepo
{
public void Insert(User user)
{
Console.WriteLine("insert user in Access");
}
public User GetUser(int userId)
{
Console.WriteLine("Get user from Access by userId");
return null;
}
}
}