Entity composed entirely of compex types - Not available to bootstrapper

Topics: Prism v4 - Silverlight 4
Dec 7, 2010 at 9:24 PM

I created a new model in EF 4.0 called email model.  It has no tables and simply conistts of a complext type with the properties

from, to , body , subject .  Basically as a wrapper for my email sending service through RIA.  I also created an email service that actually sends the email as well as associated metadata for the EmailMessage object declaring the KEY as the from property.

Everything comples fine and I can acually reference the new Email Service from my MVC web project. 



Silverlight does not seem to be able to generate a proxy class for the email service , I assume it is becuase there is nothing like a connection string or service reference to the service in the web or app.config for the RIA.

Thus I cannot create a context for the Email Service and inject it via the bootstrapper.  All my other Service objects that are tied to physical databases as well as my authentication domain service objects are accesscible.

any ideas as to how I can consume this service in my silverlight Prism application ?  Here is the code for the service

namespace Dating.Server.Data.Services
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using Dating.Server.Data.Models;
using System.Runtime.Serialization;
using System.ServiceModel;
// using System.ServiceModel.Activation;

using System.Net.Mail;

// Implements application logic using the EmailModelContainer context.
// TODO: Add your application logic to these methods or in additional methods.
// TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
// Also consider adding roles to restrict access as appropriate.
// [RequiresAuthentication]

public partial class EmailService : LinqToEntitiesDomainService<EmailModelContainer>
public bool SendEmail(EmailMessage emailMessage)
bool isEmailSendSuccessfully = false;

MailMessage mailMessage = new MailMessage(emailMessage.From, emailMessage.To);
mailMessage.Subject = emailMessage.Subject;
mailMessage.Body = emailMessage.Body;

SmtpClient smtp = new SmtpClient();
isEmailSendSuccessfully = true;

isEmailSendSuccessfully = false;

return isEmailSendSuccessfully;



I can include to designer generated code for the model as well , but is is simply a complex type


Dec 9, 2010 at 5:10 PM
Edited Dec 9, 2010 at 5:19 PM


There is no specific guidance on how to consume services in Prism out of the box. You might, however, find the following articles useful:

Also you might find this post from David Hill useful: Prism and .NET RIA Services.

As this is not related to the guidance provided by Prism, you might find better support in the WCF RIA Services forum.

Guido Leandro Maliandi