简体   繁体   English

您可以/应该使用RIA的核心域服务来执行与实体无关的服务吗?

[英]Can/Should you use RIA's core domain service to perform services not related to entities?

I am using WCF RIA services with silverlight. 我在Silverlight中使用WCF RIA服务。 Obviously I am using this primarily for retreival of entities from a datastore. 显然,我主要将其用于恢复数据存储中的实体。 My question is, is it OK to define other methods not related to CRUD operations of entites within the domain context? 我的问题是,可以定义与域上下文中实体的CRUD操作无关的其他方法吗? For example, I could define 例如,我可以定义

    [Invoke]
    public void SendEmail(String Message)
    {
        //Do Something
    }

The sendemail method would have nothing to do with the entities of my application. sendemail方法与我的应用程序的实体无关。

Is this done? 完成了吗 Any downsides? 有什么缺点吗? Should I just define standard WCF services instead? 我应该只定义标准WCF服务吗?

Looking for opinions as I can't seem to find information one way or the other. 寻找意见,因为我似乎无法以一种或另一种方式找到信息。

I think it is perfectly fine. 我认为这很好。 If you are already using RIA, I do not see any downsides. 如果您已经在使用RIA,则看不到任何缺点。 To make things more organized you can create another DomainService and separate your CRUD work of your other methods. 为了使事情更有条理,您可以创建另一个DomainService并将您的CRUD工作与其他方法分开。

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

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