static void Main(string[] args) { Print("begin..."); try { //TestRepository testRepository = new TestRepository(); //using (TransactionScope scope = new TransactionScope()) //{ // Print("Insert first Test entity..."); // var test1 = NewTestEntity(1); // testRepository.AddEntity(test1); // Print("Insert second Test entity..."); // var test2 = NewTestEntity(2); // testRepository.AddEntity(test2); // Print("Insert third Test entity..."); // Test test3 = null; // testRepository.AddEntity(test3); // scope.Complete(); //} var service = new DemandQuoteService(); var quote = NewDemandQuotesEntity(); service.NewQuoteRecord(quote); } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } } catch(Exception ex) { Print("Exception caught..."); Print(ex.ToString()); } Pause(); }
public UserController() { orderService = new OrderService(); quoteService = new DemandQuoteService(); }