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
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
// using System.ServiceModel.Activation;
// 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.
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;
I can include to designer generated code for the model as well , but is is simply a complex type