private async Task <SaveResult> CreateBillingDetail <T>(EntityManager em) where T : IBillingDetail, IEntity
        {
            var bd = em.CreateEntity <T>(EntityState.Detached);
            var ba = bd as IBankAccount;

            if (ba != null)
            {
                // because of EF TPC issues - see server comments.
                if (typeof(T) == typeof(BankAccountTPC))
                {
                    ba.Id = TestFns.GetNextInt();
                }
                ba.CreatedAt = DateTime.Now;
                ba.Owner     = "Scrooge McDuck";
                ba.Number    = "999-999-9";
                ba.BankName  = "Bank of Duckburg";
                ba.Swift     = "RICHDUCK";
            }
            else
            {
                // bd.Id = TestFns.GetNextInt();
                bd.CreatedAt = DateTime.Now;
                bd.Owner     = "Richie Rich";
                bd.Number    = "888-888-8";
            }
            em.AddEntity(bd);
            Assert.IsTrue(bd.MiscData == "asdf");
            return((SaveResult)null);
            // TODO: figure out how to save here
            //SaveResult sr = null;
            //try {
            //  sr = await em.SaveChanges();
            //  Assert.IsTrue(bd.EntityAspect.EntityState.IsUnchanged());

            //} catch (Exception e) {
            //  var x = e;
            //  throw;
            //}
            //return sr;
        }