//private static readonly String sPublishQueuePath = ".\\private$\\BankTransferQueueTransacted"; //private static void EnsureMessageQueuesExists() //{ // // Create the transacted MSMQ queue if necessary. // if (!MessageQueue.Exists(sPublishQueuePath)) // MessageQueue.Create(sPublishQueuePath, true); //} private static void CreateDummyEntities() { using (TransactionScope lScope = new TransactionScope()) using (BankEntityModelContainer lContainer = new BankEntityModelContainer()) { if (lContainer.Accounts.Count() == 0) { Customer lVideoStore = new Customer(); Account lVSAccount = new Account() { AccountNumber = 123, Balance = 0 }; lVideoStore.Accounts.Add(lVSAccount); Customer lCustomer = new Customer(); Account lCustAccount = new Account() { AccountNumber = 456, Balance = 20 }; lCustomer.Accounts.Add(lCustAccount); lContainer.Customers.AddObject(lVideoStore); lContainer.Customers.AddObject(lCustomer); lContainer.SaveChanges(); lScope.Complete(); } } }
/// <summary> /// Create a new Customer object. /// </summary> /// <param name="id">Initial value of the Id property.</param> public static Customer CreateCustomer(global::System.Int32 id) { Customer customer = new Customer(); customer.Id = id; return customer; }
/// <summary> /// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCustomers(Customer customer) { base.AddObject("Customers", customer); }