简体   繁体   English

如何使用WPF和MVVM模式在VS2013应用程序中创建/管理WCF项目

[英]How to Create/Manage a WCF Project in a VS2013 App Using WPF anf MVVM pattern

I have fiew question about the WCF Service Library. 关于WCF服务库,我有几个问题。 I'm using Visual Studio 2013 WPF and the MVVM Pattern. 我正在使用Visual Studio 2013 WPF和MVVM模式。

So in my Solution I have multiple projects and 1 of em is the WCF Service Library. 因此,在我的解决方案中,我有多个项目,而em之一就是WCF服务库。 In my Library I have a Service for Users 在我的图书馆中,我为用户提供服务

my Questions are : 我的问题是:

  1. Is it Better to separate the WCF Service Library in an another Solution ? 将WCF服务库分离到另一个解决方案中更好吗?
  2. Where should I create my UserModel ? 我应该在哪里创建UserModel? (Right now it's in my User Project not the Service Library) (现在它在我的用户项目中而不是服务库中)
  3. How should I reference my Service in my Projects 我应该如何在我的项目中引用我的服务
  4. Where and How should I store my SQL DB Connection String, how should I wrap the sensitive data like the Password ? 我应该在哪里以及如何存储SQL DB连接字符串,应该如何包装敏感数据(例如密码)?
  5. Should my Services be placed on the Server ? 我的服务应该放在服务器上吗?

Also, If you have any good Tutorials for WPF MVVM WCF Services that would greatly help. 另外,如果您有关于WPF MVVM WCF服务的良好教程,那么对您有很大帮助。

Thanks all 谢谢大家

  1. Yes: I would create a separate WCF application and run that in parrellel with your WPF app. 是的:我将创建一个单独的WCF应用程序,并将其与WPF应用程序并行运行。
  2. I'm not sure what a user model is. 我不确定用户模型是什么。
  3. You add a service reference to your exe or class library. 您将服务引用添加到您的exe或类库。 In there, you specify the endpoint address. 在此指定端点地址。
  4. Consider using Entity Framework as well. 也考虑使用实体框架。
  5. Yes or a Windows Service 是或Windows服务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM