开发者

WCF contract know the domain

I have four projects:

1. Business project that defines the business login of my project.

2. Service contract project that defines a contract interface and DTOs.

3. Service implementation project that defines an implementation to the service.

4. Web application with svc file that uses the service.

Theoretically:

A. The contract project should reference to no one.

B. The service implementation should reference the contract project and the domain.

C. The web application should reference only the contract and implementation project.

I have service like this:

AccoundData GetAccount(AccountTypeEnum type);

The problem is that AccountTyp开发者_运维技巧eEnum defined in the domain, so that the contract and the web application should have reference to the domain.. But this is what we are trying to prevent.. So how can I prevent from the contract of "knowing" the domain?


In such case you contract must use different enum / DTO and your service implementation must translate between contract enum and domain enum.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜