我在N层架构中感到困惑?请清楚我的困惑? [英] I am confuse in N tier architecture? Please clear my confusion?

查看:137
本文介绍了我在N层架构中感到困惑?请清楚我的困惑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中创建4层应用程序我用过

1. mvc客户端应用程序

2. wcf服务

3。属性层

4. dataAccess层



在dataAccess层中,我使用了实体数据模型,并且有一个App.config文件,在App.config中有一个连接字符串。当我调用一个方法时它的show execption'在应用程序配置文件中找不到名为RealEntities的连接字符串。'

然后我把我的连接字符串放在我的属性层中,并且wcf服务它的工作正常.how我使用了dataAccess图层连接字符串



我尝试过:



在我的wcf服务中,我添加了属性层的引用,属性层包含dataAccess层的引用。

i am creating 4 tier application in my application i am used
1. mvc client application
2. wcf service
3. property layer
4. dataAccess layer

In the dataAccess layer i used Entity Data Model and there is a App.config file and in the App.config there is a connection string . when i call a method its show execption 'No connection string named RealEntities could be found in the application config file.'
Then i put my connection string in my property layer and wcf service its work fine .how i used dataAccess layer connection string

What I have tried:

in my wcf service i add the reference of property layer and the property layer contain reference of dataAccess layer.

推荐答案

你应该在WCF的web.config中添加你的连接字符串应用程序。

因为服务后面的所有图层(二进制文件)都只在服务层中引用。
You should add your connection string in web.config in WCF application.
Because all your layers(binaries) behind your service will be referenced in service layer only.


这篇关于我在N层架构中感到困惑?请清楚我的困惑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆