public AdminController(ICategoriesRepository _categoryRepo, IEventFormsRepo _eventFormRepo, IBusinessFormsRepo _businessFormRepo, IMapper _mapper) { this.categoryRepo = _categoryRepo; this.eventFormsRepo = _eventFormRepo; this.businessFormsRepo = _businessFormRepo; this.mapper = _mapper; }
public static void SeedForms(IBusinessFormsRepo _businessFormsRepo, IEventFormsRepo _eventFormsRepo) { //var newForms = GetSeedEventForms(); //foreach (var item in newForms) //{ // var existingForm = _eventFormsRepo.Find(f => f.FormName == item.FormName).ToList(); // if (existingForm.Count < 1 ) // { // _eventFormsRepo.Add(item); // } //} var newBusinessForms = GetSeedBusinessForms(); foreach (var item in newBusinessForms) { var existingForm = _businessFormsRepo.Find(f => f.FormName == item.FormName).ToList(); if (existingForm.Count < 1) { _businessFormsRepo.Add(item); } } }
public ListingCleaner(IEventFormsRepo _eventForms, IBusinessFormsRepo _businessForms) { this.EventDescriptionOverrides = new Dictionary <EventType, string>(); this.BusinessDescriptionOverrides = new Dictionary <BusinessType, string>(); var eventForms = _eventForms.GetAll().ToList(); foreach (var form in eventForms) { if (!string.IsNullOrWhiteSpace(form.DefaultDescriptionText)) { EventDescriptionOverrides.Add(form.Type, form.DefaultDescriptionText); } } var businessForms = _businessForms.GetAll().ToList(); foreach (var form in businessForms) { if (!string.IsNullOrWhiteSpace(form.DefaultDescriptionText)) { BusinessDescriptionOverrides.Add(form.BusinessType, form.DefaultDescriptionText); } } }
public static void SeedAll(ICategoriesRepository _categoriesRepo, IBusinessFormsRepo _businessFormsRepo, IEventFormsRepo _eventFormsRepo, IEventsRepository _eventRepo, IBusinessRepository _businessRepo) { SeedCategories(_categoriesRepo); SeedForms(_businessFormsRepo, _eventFormsRepo); SeedBusinesses(_businessRepo); SeedEvents(_eventRepo); }
public SeedController(IOptions <DbSettings> _settings, ICategoriesRepository _categoriesRepo, IBusinessFormsRepo _businessForms, IEventFormsRepo _eventForms, IEventsRepository _eventRepo, IBusinessRepository _businessRepo) { this.settings = _settings; this.categoriesRepo = _categoriesRepo; this.businessForms = _businessForms; this.eventForms = _eventForms; this.eventRepo = _eventRepo; this.businessRepo = _businessRepo; }
public static void DropFormCollections(IEventFormsRepo _eventForms, IBusinessFormsRepo _businessForms) { _eventForms.Db.DropCollection("eventforms"); _businessForms.Db.DropCollection("businessforms"); }
public EventsController(IEventsRepository _eventRepo, ICategoriesRepository _categoryRepo, IEventFormsRepo _formsRepo) { this.eventsRepo = _eventRepo; this.categoryRepo = _categoryRepo; this.formsRepo = _formsRepo; }