markus / DataBase / DatabseModelCRUDSampleDLL / TestDataBase.cs @ 472d507b
이력 | 보기 | 이력해설 | 다운로드 (1.05 KB)
1 |
using Markus.EntityModel; |
---|---|
2 |
using System; |
3 |
using System.Collections.Generic; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using System.Threading.Tasks; |
7 |
|
8 |
namespace DatabseModelCRUDSampleDLL |
9 |
{ |
10 |
/// <summary> |
11 |
/// MarkusModel이용한 데이터 CRUD |
12 |
/// </summary> |
13 |
public class TestDataBase : IDisposable |
14 |
{ |
15 |
MarkusModel entities; |
16 |
|
17 |
public TestDataBase(string ConnectionString) |
18 |
{ |
19 |
try |
20 |
{ |
21 |
//해당 프로젝트의 데이터베이스 연결 |
22 |
entities = new MarkusModel(ConnectionString); |
23 |
} |
24 |
catch (Exception ex) |
25 |
{ |
26 |
throw ex; |
27 |
} |
28 |
} |
29 |
|
30 |
public List<CONVERTER_DOC> GetConvertDoc(int takeCount) |
31 |
{ |
32 |
return entities.CONVERTER_DOC.Take(takeCount).ToList(); |
33 |
} |
34 |
|
35 |
/// <summary> |
36 |
/// 완료 후 Dispose |
37 |
/// </summary> |
38 |
public void Dispose() |
39 |
{ |
40 |
if (entities != null) |
41 |
{ |
42 |
entities.Dispose(); |
43 |
} |
44 |
} |
45 |
} |
46 |
} |