Ejemplo n.º 1
0
 /// <inheritdoc />
 public DatabaseBackedCharacterSessionRepository(CharacterDatabaseContext context,
                                                 [NotNull] ILogger <DatabaseBackedCharacterSessionRepository> logger)
 {
     Context            = context ?? throw new ArgumentNullException(nameof(context));
     Logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     GenericCrudService = new GeneralGenericCrudRepositoryProvider <int, CharacterSessionModel>(context.CharacterSessions, context);
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public BaseGenericBackedDatabaseRepository([JetBrains.Annotations.NotNull] TContextType context)
        {
            Context = context ?? throw new ArgumentNullException(nameof(context));

            GenericRepository = new GeneralGenericCrudRepositoryProvider <TKey, TModel>(context.Set <TModel>(), context);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public Task UpdateAsync(int key, CharacterEntryModel model)
        {
            GeneralGenericCrudRepositoryProvider <int, CharacterEntryModel> crudProvider = new GeneralGenericCrudRepositoryProvider <int, CharacterEntryModel>(Context.Characters, Context);

            return(crudProvider.UpdateAsync(key, model));
        }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public DatabaseBackedGroupEntryRepository([JetBrains.Annotations.NotNull] CharacterDatabaseContext context)
 {
     Context = context ?? throw new ArgumentNullException(nameof(context));
     GenericBackedRepository = new GeneralGenericCrudRepositoryProvider <int, CharacterGroupEntryModel>(context.Groups, context);
 }
Ejemplo n.º 5
0
        /// <inheritdoc />
        public DatabaseBackedCharacterFriendRelationshipRepository([JetBrains.Annotations.NotNull] CharacterDatabaseContext context)
        {
            Context = context ?? throw new ArgumentNullException(nameof(context));

            GenericRepository = new GeneralGenericCrudRepositoryProvider <int, CharacterFriendRelationshipModel>(context.CharacterFriendRequests, context);
        }
Ejemplo n.º 6
0
        /// <inheritdoc />
        public Task UpdateAsync(int key, ZoneInstanceEntryModel model)
        {
            GeneralGenericCrudRepositoryProvider <int, ZoneInstanceEntryModel> crudProvider = new GeneralGenericCrudRepositoryProvider <int, ZoneInstanceEntryModel>(Context.ZoneEntries, Context);

            return(crudProvider.UpdateAsync(key, model));
        }
Ejemplo n.º 7
0
        /// <inheritdoc />
        public Task <bool> TryDeleteAsync(int key)
        {
            GeneralGenericCrudRepositoryProvider <int, CharacterLocationModel> crudProvider = new GeneralGenericCrudRepositoryProvider <int, CharacterLocationModel>(Context.CharacterLocations, Context);

            return(crudProvider.TryDeleteAsync(key));
        }
Ejemplo n.º 8
0
 /// <inheritdoc />
 public DatabaseBackedWorldEntryRepository(ContentDatabaseContext databaseContext)
 {
     DatabaseContext   = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext));
     DefaultRepository = new GeneralGenericCrudRepositoryProvider <long, WorldEntryModel>(databaseContext.Worlds, databaseContext);
 }
Ejemplo n.º 9
0
 /// <inheritdoc />
 protected BaseCustomContentRepository(ContentDatabaseContext databaseContext)
 {
     DatabaseContext   = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext));
     DefaultRepository = new GeneralGenericCrudRepositoryProvider <long, TCustomContentModelType>(databaseContext.Set <TCustomContentModelType>(), databaseContext);
 }