Beispiel #1
0
 public void Init()
 {
     using (var objectAssociationType = new ObjectTypeRepository())
     {
         objectAssociationType.InsertOrUpdate(new ObjectType {
             Name = "Type"
         });
         objectAssociationType.Save();
         _objectType = objectAssociationType.All.FirstOrDefault(ot => ot.Name == "Type");
     }
 }
Beispiel #2
0
 public void CleanUp()
 {
     using (var objectAssociationType = new ObjectTypeRepository())
     {
         _objectType = objectAssociationType.All.FirstOrDefault(ot => ot.Name == "Type");
         if (_objectType != null)
         {
             objectAssociationType.Delete(_objectType.ObjectTypeId);
         }
         objectAssociationType.Save();
     }
 }
Beispiel #3
0
 public CampEFCoreService(CampDbContext db) : base()
 {
     DbContext        = db;
     CampCategories   = new CampCategoryRepository(db);
     CampBatches      = new CampBatchRepository(db);
     Camps            = new CampRepository(db);
     Diets            = new DietRepository(db);
     Instructors      = new InstructorRepository(db);
     InstructorRoles  = new InstructorRoleRepository(db);
     ObjectOrders     = new ObjectOrderRepository(db);
     Objects          = new ObjectRepository(db);
     ObjectTypePrices = new ObjectTypePriceRepository(db);
     ObjectTypes      = new ObjectTypeRepository(db);
     Payments         = new PaymentRepository(db);
     Photos           = new PhotoRepository(db);
     Context          = new HttpContextAccessor();
     LoggerFactory    = new LoggerFactory();
     LoggerFactory.AddFile("Logs/{Date}.txt");
     Logger = LoggerFactory.CreateLogger("Log");
 }
Beispiel #4
0
 public static ObjectType GetCss() => ObjectTypeRepository.GetByName(_css);
Beispiel #5
0
 public static ObjectType GetJavaScript() => ObjectTypeRepository.GetByName(_javaScript);
Beispiel #6
0
 public static ObjectType GetForm() => ObjectTypeRepository.GetByName(_form);
Beispiel #7
0
 public static ObjectType GetContainer() => ObjectTypeRepository.GetByName(_container);
Beispiel #8
0
 public static ObjectType GetGeneric() => ObjectTypeRepository.GetByName(_generic);