private static void StageData() { var data = new FakeData(); //var context = new FakeCloudCompareContext(); //var context = new CloudCompareContext(); //string conn = ConfigurationManager.ConnectionStrings["CompareCloudware.POCOQueryRepository.CloudCompareContext"].ConnectionString; var context = new TMDContext(); data.LoadFakeReferenceData(context); try { context.SaveChanges(); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } catch (DbUpdateException dbEx) { foreach (var validationErrors in dbEx.Entries) { //foreach (var validationError in validationErrors.ValidationErrors) { //Trace.TraceInformation("Property: {0} Error: {1}", validationErrors.Property, validationErrors.ErrorMessage); } } } //data.LoadFakeProductionData(context); ////data.SetLiveStatuses(context); //try //{ // context.SaveChanges(); //} //catch (DbEntityValidationException dbEx) //{ // foreach (var validationErrors in dbEx.EntityValidationErrors) // { // foreach (var validationError in validationErrors.ValidationErrors) // { // Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); // } // } //} //catch (DbUpdateException dbEx) //{ // foreach (var validationErrors in dbEx.Entries) // { // //foreach (var validationError in validationErrors.ValidationErrors) // { // //Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); // } // } //} ////LoadRatings(); ////LoadApplicationWeightings(); ////LoadTwitterFollowers(); ////LoadFacebookFans(); }
public QueryRepository(TMDContext context) : base(context) { _context = context; }