본문 바로가기
개인 작업

09. 서버 작업 근황3

by NaHyungMin 2019. 10. 6.

예전에 엔티티 프레임워크를 사용해 본 기억이 있어서 dapper를 사용해볼까 해서 알아봤다.

 

결론부터 말하자면 코드는 조금 구현했는데 폐기하기로 했다.

 

이유는 쿼리를 어느 정도 구현할 수 있으면 써야할 매력이 없었다.

얕은 지식으로 섣부른 판단을 한걸 수도 있는데 예전에 구현했던 Sql ReadTable 클래스형식보다 불필요한 ORM 매핑이 많이 이루어질 거라 생각했다.

 

프로시저는 많은 수가 있을 수 있는데 만약 같은 테이블 1~100까지 컬럼을 반환한다고 하면 쿼리에서는 30, 50, 80, 100을 반환할 수도 있다.

 

그렇다면 Return 값을 받는 클래스는 어떤 처리를 해야 할까?

30, 50, 80, 100을 받는 클래스를 하나 씩 생성해야 할까?

아니면 100으로 Return을 받고 사용하지 않는 부분은 개발자가 알아서 빼고 처리해야 하는걸까?

 

두 개 이상의 클래스를 혼합해서 사용한다고 할 때, 사용되지 않는 변수가 상당할 거라는 생각이 들었다.

 

그냥 기존에 만들었던 클래스나 더 최적화 해야겠다.

괜히 시간만 날렸다. ㅠ.ㅠ

 

혹시 모를 dapper를 사용할 사람을 위해 조사한 결과를 남긴다.

 

https://stackoverflow.com/questions/21598437/execute-stored-procedure-w-parameters-in-dapper

 

Execute stored procedure w/parameters in Dapper

I'm using Dapper (thanks Sam, great project.) a micro ORM with a DAL and by some reason I'm not able to execute stored procedures with input parameters. In a example service I've the following co...

stackoverflow.com

https://github.com/StackExchange/Dapper

 

StackExchange/Dapper

Dapper - a simple object mapper for .Net. Contribute to StackExchange/Dapper development by creating an account on GitHub.

github.com

https://dapper-tutorial.net/execute

 

Dapper Execute | Dapper Tutorial and Documentation

Dapper Tutorial Dapper - Execute Description Execute is an extension method which can be called from any object of type IDbConnection. It can execute a command one or multiple times and return the number of affected rows. This method is usually used to exe

dapper-tutorial.net

아파치 라이센스 사용하려면 프로젝트 내부나 프로그램에 명시해야 한다.

'개인 작업' 카테고리의 다른 글

11. 클라이언트 작업 근황2  (0) 2019.10.15
10. 전체 작업 근황2  (0) 2019.10.11
08. 전체 작업 근황1  (0) 2019.10.05
07. 서버 작업 근황2  (0) 2019.10.02
06. 클라이언트 작업 근황1  (0) 2019.10.01