Esempio n. 1
0
 public void Save()
 {
     if (model.Id == Guid.Empty)
     {
         repository.Insert(model);
     }
     else
     {
         repository.Update(model);
     }
 }
Esempio n. 2
0
        public void AddUserToGroupFunction()
        {
            groupMemberModel.Id = Guid.NewGuid();
            groupMemberRepository.Insert(groupMemberModel);
            var user = userRepository.GetUserByEmail(this.addedUserEmail);

            groupMemberModel.User  = user;
            groupMemberModel.Group = LoggedUserID.actualGroupModel;
            groupMemberRepository.dbContext.RemoveEntities <GroupEntity>();
            groupMemberRepository.dbContext.RemoveEntities <UserEntity>();
            groupMemberRepository.Update(groupMemberModel);
            mediator.Send(new AddedMemberMessage());
            addedUserEmail = string.Empty;
            OnPropertyChanged("groupMemberModel");
        }