public GroupViewModel(IGroupRepository repository) : base(repository) { userRepository = NetCoreProvider.Resolve <IUserRepository>(); AddUserCommand = new RelayCommand <UserDto>(arg => { if (arg == null) { return; } var user = GroupDto.GroupUsers?.FirstOrDefault(t => t.Account == arg.Account); if (user == null) { GroupDto.GroupUsers?.Add(new GroupUserDto() { Account = arg.Account }); } }); DelUserCommand = new RelayCommand <GroupUserDto>(arg => { if (arg == null) { return; } var user = GroupDto.GroupUsers?.FirstOrDefault(t => t.Account == arg.Account); if (user != null) { GroupDto.GroupUsers?.Remove(user); } }); groupRepository = repository; }
public GlobalLoger() { this.log = NetCoreProvider.Resolve <ILog>(); }
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { MessageBox.Show(e.Exception.Message); NetCoreProvider.Resolve <ILog>()?.Warn(e.Exception, e.Exception.Message); e.Handled = true; }