Exemple #1
0
 public ObservableCollection<ParticipantModel> GetParticipantModelFrom(
     ICollection<Participant> entities)
 {
     ObservableCollection<ParticipantModel> collection =
         new ObservableCollection<ParticipantModel>();
     foreach (Participant entity in entities) {
         ParticipantModel model = new ParticipantModel(entity);
         collection.Add(model);
     }
     return collection;
 }
        private void AddParticipant()
        {
            using (AppContext context = new AppContext()) {
                var participant = context.Participants.Create();

                participant.Name = "Update Name";
                participant.Contact = new DomainObjects.Entities.ContactDetails();
                participant.Contact.Address1 = "Update Contact Info";

                context.Participants.Add(participant);
                context.SaveChanges();

                SelectedParticipant = new ParticipantModel(participant);
                Participants.Add(SelectedParticipant);
            }
        }