public UpdatePermissionsCommandHandlerTestsFixture SetAccountProviderLegalEntity() { AccountProviderLegalEntity = EntityActivator.CreateInstance <AccountProviderLegalEntity>() .Set(aple => aple.Id, 4) .Set(aple => aple.AccountProviderId, AccountProvider.Id) .Set(aple => aple.AccountLegalEntityId, AccountLegalEntity.Id); AccountProvider.Add(ap => ap.AccountProviderLegalEntities, AccountProviderLegalEntity); Db.SaveChanges(); return(this); }