[Route("")] [HttpPut] public IHttpActionResult UpdateAccount(EditAccountViewModel accountViewModel) { // Update Contacts _contactsAdapter.UpdateContactsAndChildren(accountViewModel.ContactPerson); Accounts account = AutoMapper.Mapper.Map<EditAccountViewModel, Accounts>(accountViewModel); // The web page assigns false/true or 0/1, converting here. if (account.WebITtype == 0) { account.WebITtype = 2; } else { account.WebITtype = 1; } List<DualListViewModel> currentSecAcct = (from secAcct in _secAcctAdapter.GetAll() join secRoles in _secRoleAdapter.GetAllRoles() on secAcct.RoleNo equals secRoles.RoleNo where secAcct.AcctName == accountViewModel.AcctName select new DualListViewModel { Descrip = secRoles.Descrip, ItemId = secAcct.PriKey }).ToList(); if (accountViewModel.AssignedRoles.Any()) { if (currentSecAcct.Any()) { List<DualListViewModel> newSecRoles = accountViewModel.AssignedRoles.Except(currentSecAcct.AsEnumerable()).ToList(); List<DualListViewModel> removedSecRoles = currentSecAcct.Except(accountViewModel.AssignedRoles.AsEnumerable()).ToList(); foreach (var role in newSecRoles) { SecAcct secAcct = new SecAcct(); secAcct.RoleNo = role.ItemId; secAcct.AcctName = accountViewModel.AcctName; _secAcctAdapter.Add(secAcct); } foreach (var role in removedSecRoles) { _secAcctAdapter.Delete(role.ItemId); } } else { foreach (var role in accountViewModel.AssignedRoles) { SecAcct secAcct = new SecAcct(); secAcct.RoleNo = role.ItemId; secAcct.AcctName = accountViewModel.AcctName; _secAcctAdapter.Add(secAcct); } } } else if (currentSecAcct.Any()) { foreach (var roles in currentSecAcct) { _secAcctAdapter.Delete(roles.ItemId); } } SetOperatorAndSalespoint(account); // Update contactId var contatId = accountViewModel.ContactPerson.ContactId; account.ContactId = contatId; _accountsAdapter.Update(account); accountViewModel = AutoMapper.Mapper.Map<Accounts, EditAccountViewModel>(account); // Update contact with latest information accountViewModel.ContactPerson = _contactsAdapter.GetContactsAndChildrenById(contatId); return Ok(accountViewModel); }The SetOperatorAndSalespoint(account) is what I'd like to make a filter if I am going to go with the filter route. But the question is - how from the filter I can access the accountViewModel (any view model) and set the properties of it (and these properties are only in a few of the models, not in every model).