public ImageService(
            IModelDbFactory modelDbFactory,
            IAutoMapperService mapper,
            IEfDbContextSaveChanges context,
            IPhotoArtSystemEfDbRepository <Image> images,
            IImageCloudStorage storage)
        {
            Guard.WhenArgument(
                modelDbFactory,
                GlobalConstants.ModelDbFactoryRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                images,
                GlobalConstants.ImageEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                storage,
                GlobalConstants.CloudStorageRequiredExceptionMessage).IsNull().Throw();

            this.modelDbFactory = modelDbFactory;
            this.mapper         = mapper;
            this.context        = context;
            this.images         = images;
            this.storage        = storage;
        }
Example #2
0
        public MultimediaService(
            IModelDbFactory modelDbFactory,
            ISanitizer sanitizer,
            IAutoMapperService mapper,
            IEfDbContextSaveChanges context,
            IPhotoArtSystemEfDbRepository <Multimedia> multimedia)
        {
            Guard.WhenArgument(
                modelDbFactory,
                GlobalConstants.ModelDbFactoryRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                sanitizer,
                GlobalConstants.SanitizerRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                multimedia,
                GlobalConstants.MultimediaEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();

            this.modelDbFactory = modelDbFactory;
            this.sanitizer      = sanitizer;
            this.mapper         = mapper;
            this.context        = context;
            this.multimedia     = multimedia;
        }
        public PerformanceQueryServiceDecorator(
            IEfRepository <PerformanceEntry> performanceRepository,
            IEfDbContextSaveChanges contextSaveChanges,
            IDateTimeProvider timeProvider,
            IQueryService <TQuery, TResult> decoratee)
        {
            if (performanceRepository is null)
            {
                throw new ArgumentNullException(nameof(performanceRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            if (timeProvider is null)
            {
                throw new ArgumentNullException(nameof(timeProvider));
            }

            if (decoratee is null)
            {
                throw new ArgumentNullException(nameof(decoratee));
            }

            this.performanceRepository = performanceRepository;
            this.contextSaveChanges    = contextSaveChanges;
            this.timeProvider          = timeProvider;
            this.decoratee             = decoratee;
        }
        public PhotocourseService(
            IModelDbFactory modelDbFactory,
            ISanitizer sanitizer,
            IAutoMapperService mapper,
            IEfDbContextSaveChanges context,
            IPhotoArtSystemEfDbRepository <Photocourse> photocourses)
        {
            Guard.WhenArgument(
                modelDbFactory,
                GlobalConstants.ModelDbFactoryRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                sanitizer,
                GlobalConstants.SanitizerRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                photocourses,
                GlobalConstants.PhotocourseEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();

            this.modelDbFactory = modelDbFactory;
            this.sanitizer      = sanitizer;
            this.mapper         = mapper;
            this.context        = context;
            this.photocourses   = photocourses;
        }
Example #5
0
        public UploadSongCommandService(
            IEfRepository <Song> songRepository,
            ISongProvider songProvider,
            IDateTimeProvider timeProvider,
            IEfDbContextSaveChanges contextSaveChanges)
        {
            if (songRepository is null)
            {
                throw new ArgumentNullException(nameof(songRepository));
            }

            if (songProvider is null)
            {
                throw new ArgumentNullException(nameof(songProvider));
            }

            if (timeProvider is null)
            {
                throw new ArgumentNullException(nameof(timeProvider));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            this.songRepository     = songRepository;
            this.songProvider       = songProvider;
            this.timeProvider       = timeProvider;
            this.contextSaveChanges = contextSaveChanges;
        }
 public RejectSongCommandService(
     IEfRepository <Song> songRepository,
     ISongProvider songProvider,
     IEfDbContextSaveChanges contextSaveChanges)
     : base(songRepository, songProvider, contextSaveChanges)
 {
 }
Example #7
0
        public ModifyService(IEfDbSetWrapper <T> dbSetWrapper, IEfDbContextSaveChanges dbContextSaveChanges)
        {
            Guard.WhenArgument(dbSetWrapper, "dbSetWrapper").IsNull().Throw();
            Guard.WhenArgument(dbContextSaveChanges, "dbContextSaveChanges").IsNull().Throw();

            this.dbSetWrapper         = dbSetWrapper;
            this.dbContextSaveChanges = dbContextSaveChanges;
        }
Example #8
0
        public ShoppingBasketService(IShoppingBasketDto shoppingBasketDto, IMapperService mapperService, IEfDbSetWrapper <ShoppingBasket> efDbSetWrapper, IEfDbContextSaveChanges efDbContextSaveChanges)
        {
            Guard.WhenArgument(shoppingBasketDto, "shoppingBasket").IsNull().Throw();

            this.shoppingBasketDto      = shoppingBasketDto;
            this.mapperService          = mapperService;
            this.efDbSetWrapper         = efDbSetWrapper;
            this.efDbContextSaveChanges = efDbContextSaveChanges;
        }
        public StudentService(IAutoMapperService mapper, IEfDbContextSaveChanges context, IPhotoArtSystemEfDbRepository <Student> students)
        {
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                students,
                GlobalConstants.StudentEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();

            this.mapper   = mapper;
            this.context  = context;
            this.students = students;
        }
        public ApproveSongCommandService(
            IEfRepository <Song> songRepository,
            IEfDbContextSaveChanges contextSaveChanges)
        {
            if (songRepository is null)
            {
                throw new ArgumentNullException(nameof(songRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            this.songRepository     = songRepository;
            this.contextSaveChanges = contextSaveChanges;
        }
Example #11
0
        public RegisterPermissionsCommandService(
            IEfRepository <Permission> permissionRepository,
            IEfDbContextSaveChanges contextSaveChanges)
        {
            if (permissionRepository is null)
            {
                throw new ArgumentNullException(nameof(permissionRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            this.permissionRepository = permissionRepository;
            this.contextSaveChanges   = contextSaveChanges;
        }
Example #12
0
        public InformationService(
            IAutoMapperService mapper,
            IEfDbContextSaveChanges context,
            IPhotoArtSystemEfDbRepository <Information> information)
        {
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                information,
                GlobalConstants.InformationEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();

            this.mapper      = mapper;
            this.context     = context;
            this.information = information;
        }
        public AuditingCommandServiceDecorator(
            IEfRepository <AuditEntry> auditingRepository,
            IEfDbContextSaveChanges contextSaveChanges,
            IDateTimeProvider timeProvider,
            IUserContext userContext,
            ICommandService <TCommand> decoratee)
        {
            if (auditingRepository is null)
            {
                throw new ArgumentNullException(nameof(auditingRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            if (timeProvider is null)
            {
                throw new ArgumentNullException(nameof(timeProvider));
            }

            if (userContext is null)
            {
                throw new ArgumentNullException(nameof(userContext));
            }

            if (decoratee is null)
            {
                throw new ArgumentNullException(nameof(decoratee));
            }

            this.auditingRepository = auditingRepository;
            this.contextSaveChanges = contextSaveChanges;
            this.timeProvider       = timeProvider;
            this.userContext        = userContext;
            this.decoratee          = decoratee;
        }
        public UnhandledExceptionLogger(
            IEfRepository <UnhandledExceptionEntry> unhandledExceptionRepository,
            IEfDbContextSaveChanges contextSaveChanges,
            IDateTimeProvider timeProvider)
        {
            if (unhandledExceptionRepository is null)
            {
                throw new ArgumentNullException(nameof(unhandledExceptionRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            if (timeProvider is null)
            {
                throw new ArgumentNullException(nameof(timeProvider));
            }

            this.unhandledExceptionRepository = unhandledExceptionRepository;
            this.contextSaveChanges           = contextSaveChanges;
            this.timeProvider = timeProvider;
        }
        public DemoteUserFromRoleCommandService(
            IEfRepository <User> userRepository,
            IEfRepository <Role> roleRepository,
            IEfDbContextSaveChanges contextSaveChanges)
        {
            if (userRepository is null)
            {
                throw new ArgumentNullException(nameof(userRepository));
            }

            if (roleRepository is null)
            {
                throw new ArgumentNullException(nameof(roleRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            this.userRepository     = userRepository;
            this.roleRepository     = roleRepository;
            this.contextSaveChanges = contextSaveChanges;
        }
Example #16
0
 public SaveChangesFilter(IEfDbContextSaveChanges contextSaveChanges)
 {
     Guard.WhenArgument(contextSaveChanges, "contextSaveChanges").IsNull().Throw();
     this.contextSaveChanges = contextSaveChanges;
 }