Skip to content

Instantly share code, notes, and snippets.

@BryanWilhite
Created November 13, 2014 00:25
Show Gist options
  • Save BryanWilhite/f038dc5740efe76872aa to your computer and use it in GitHub Desktop.
Save BryanWilhite/f038dc5740efe76872aa to your computer and use it in GitHub Desktop.
C#: RIA Services, EF and Partial Methods
using System.ServiceModel.DomainServices.Client;
using GalaSoft.MvvmLight.Messaging;
namespace My.Entities
{
using My.Entities.Extensions;
using My.Silverlight.Models;
public sealed partial class MyEntity : Entity
{
partial void OnCreated()
{
var message = new LightNotificationMessageAction<string>("MyEntity",
s =>
{
this.SetDefaultValues(s);
})
{
Source = LightMessageSource.Model,
UniqueId = "Entity"
};
Messenger.Default.Send(message);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment