示例#1
0
        public async Task <CreateNmedianPayload> CreateNmedianAsync(
            CreateNmedianInput input,
            [Service] IDateTimeOffset dateTimeOffset,
            [Service] IGuid guid,
            [ScopedService] NmediaContext dbContext,
            CancellationToken cancellationToken
            )
        {
            var entity = new Nmedian
            {
                Age        = input.Age,
                Created    = dateTimeOffset.Now,
                IsActive   = input.IsActive,
                Hired      = input.Hired,
                HourlyRate = input.HourlyRate,
                JobTitle   = input.JobTitle,
                Name       = input.Name,
                Picture    = input.Picture,
                Slug       = input.Slug,
                Uuid       = guid.NewGuid()
            };

            dbContext.Nmedians.Add(entity);
            await dbContext.SaveChangesAsync(cancellationToken);

            return(new CreateNmedianPayload(entity));
        }
示例#2
0
 public TicTacToeHub(ICurrentUserService currentUserService, IGuid guid, IRandom random, IMediator mediator)
 {
     this.currentUserService = currentUserService;
     this.guid     = guid;
     this.random   = random;
     this.mediator = mediator;
 }
示例#3
0
        protected bool Remove <T>(IGuid entity, DbSet <T> entitySet) where T : class, IGuid
        {
            if (!(entity is T))
            {
                return(false);
            }

            var guid = entity.Guid;

            entity = entitySet.FirstOrDefault(c => c.Guid == guid);
            if (entity == null)
            {
                return(true);
            }

            if (UiSynchronizationContext == null)
            {
                entitySet.Remove((T)entity);
            }
            else
            {
                UiSynchronizationContext.Send(_ => entitySet.Remove((T)entity), null);
            }
            return(true);
        }
示例#4
0
 public CreateSessionCmdHandler(ILynxDbContext dbContext, IDateTime dateTime, IGuid guid, IMapper mapper)
 {
     p_DbContext = dbContext;
     p_DateTime  = dateTime;
     p_Guid      = guid;
     p_Mapper    = mapper;
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Daemon" /> class.
 /// </summary>
 public Daemon(ILogger <Daemon> logger, IMessageHandling messageHandling, INow now, IGuid guid, IDbContexts dbContexts)
 {
     _logger          = logger;
     _messageHandling = messageHandling;
     _guid            = guid;
     _now             = now;
     _dbContexts      = dbContexts;
 }
 public CreateMeasureCommandHandler(IGuid guid,
                                    IMapper mapper,
                                    IMeasuresRepository measuresRepository)
 {
     _guid               = guid;
     _mapper             = mapper;
     _measuresRepository = measuresRepository;
 }
示例#7
0
 public AlbumService(IUnitOfWork unitOfWork,
                     IClock clock,
                     IGuid guid)
 {
     _unitOfWork = unitOfWork;
     _clock      = clock;
     _guid       = guid;
 }
示例#8
0
 public TransactionManager(ITransactionReportRepository transactionReportRepository, IGuid guid,
                           IVirtualNumberApiAccess virtualNumberApiAccess, IBatchReportRepository batchReportRepository)
 {
     this.transactionReportRepository = transactionReportRepository;
     this.guid = guid;
     this.virtualNumberApiAccess = virtualNumberApiAccess;
     this.batchReportRepository  = batchReportRepository;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="identityService"></param>
 /// <param name="dateTime"></param>
 /// <param name="guid"></param>
 /// <param name="customLogger"></param>
 public AuditableService(IIdentityService identityService, IDateTime dateTime,
                         IGuid guid, ICustomLogger <AuditableService> customLogger)
 {
     _identityService = identityService;
     _dateTime        = dateTime;
     _guid            = guid;
     _customLogger    = customLogger;
 }
示例#10
0
 public UpdateProductCommandHandler(IGuid guid, IMapper mapper, IProductsRepository productsRepository, IProductCategoriesRepository productCategoriesRepository,
                                    IMeasuresRepository measuresRepository)
 {
     _guid                        = guid;
     _mapper                      = mapper;
     _productsRepository          = productsRepository;
     _productCategoriesRepository = productCategoriesRepository;
     _measuresRepository          = measuresRepository;
 }
 public CreateRecipeCommandHandler(IGuid guid, IMapper mapper, IRecipesRepository recipesRepository, IProductsRepository productsRepository,
                                   IProductMeasuresRepository productMeasuresRepository)
 {
     _guid                      = guid;
     _mapper                    = mapper;
     _recipesRepository         = recipesRepository;
     _productsRepository        = productsRepository;
     _productMeasuresRepository = productMeasuresRepository;
 }
示例#12
0
 protected Character(string name, ICombatAttributes combatAttributes, double experienceWorth = 0, double goldWorth = 0)
 {
     this.name                     = name;
     this.combatAttributes         = combatAttributes;
     this.experienceWorth          = experienceWorth;
     this.goldWorth                = goldWorth;
     this.guid                     = GuidProvider.Instance.GetNewGuid();
     this.possibleCharacterActions = new List <ICharacterAction>();
 }
示例#13
0
 public CreateProductCategoryCommandHandler(
     IGuid guid,
     IMapper mapper,
     IProductCategoriesRepository productCategoriesRepository)
 {
     _guid   = guid;
     _mapper = mapper;
     _productCategoriesRepository = productCategoriesRepository;
 }
示例#14
0
 public RecurringBatchController(IClock clock,
                                 IManageRecurringBatches recurringBatchesManager,
                                 IOptions <PagingConfiguration> paginationConfiguration,
                                 IGuid guid, IManageExport exportManager) : base(exportManager)
 {
     this.clock = clock;
     this.recurringBatchesManager = recurringBatchesManager;
     this.paginationConfiguration = paginationConfiguration;
     this.guid = guid;
 }
示例#15
0
    public bool Equals(IGuid other)
    {
        var o = other as SystemGuid;

        if (o == null)
        {
            return(false);
        }
        return(o.guid.Equals(guid));
    }
示例#16
0
        public Config GetDiffAnnotatedConfig(Config curr, IConfig prev, IConfig old)
        {
            VmBindable.IsValidateAll = false;
            curr.PluginSettingsToModel();
            var proto = Config.ConvertToProto(curr);

            this.DiffAnnotatedConfig = new Config(proto);
            ModelVisitorForAnnotation.InitConfig(this.DiffAnnotatedConfig);
            int dicNodesCount = this.DiffAnnotatedConfig.DicNodes.Count;
            var nv            = new ModelVisitorNodeGenSettings();

            nv.NodeGenSettingsApplyAction(this.DiffAnnotatedConfig, (p) =>
            {
                p.RestoreNodeAppGenSettingsVm();
            });
            VmBindable.IsValidateAll = true;

            //foreach (var t in curr.DicActiveAppProjectGenerators)
            //{
            //    this.DiffAnnotatedConfig.DicActiveAppProjectGenerators[t.Key] = t.Value;
            //}
            //foreach (var t in curr.DicGenNodeSettings)
            //{
            //    this.DiffAnnotatedConfig.DicGenNodeSettings[t.Key] = t.Value;
            //}
            //foreach (var t in curr.DicNodes)
            //{
            //    this.DiffAnnotatedConfig.DicNodes[t.Key] = t.Value;
            //}
            //this.DiffAnnotatedConfig.DicGenerators = curr.DicGenerators;
            //this.DiffAnnotatedConfig.DicPluginLists = curr.DicPluginLists;
            //this.DiffAnnotatedConfig.DicPlugins = curr.DicPlugins;
            //this.DiffAnnotatedConfig.AddAllAppGenSettingsVmsToNode();


            this.ListGuidsRenamedObjects = new List <string>();
            base.RunThroughConfig(this.DiffAnnotatedConfig, prev, old, (visitor, obj) =>
            {
                if (obj is IGuid)
                {
                    IGuid curr2 = (IGuid)obj;
                    if (obj.IsRenamed())
                    {
                        ListGuidsRenamedObjects.Add(curr2.Guid);
                    }
                }
            });
            Debug.Assert(dicNodesCount <= this.DiffAnnotatedConfig.DicNodes.Count);
            foreach (var t in curr.Model.DicGenNodeSettings)
            {
                this.DiffAnnotatedConfig.Model.DicGenNodeSettings[t.Key] = t.Value;
            }

            return(this.DiffAnnotatedConfig);
        }
        private static void AddReferenceFromNode(ModelNode md, IGuid property, IGuid from)
        {
            if (!md.DicReferecedFromNodes.ContainsKey(from.Guid))
            {
                md.DicReferecedFromNodes[from.Guid] = new ReferenceFrom();
            }
            var tn = md.DicReferecedFromNodes[from.Guid];

            tn.DicFromFields[property.Guid] = property;
            tn.FromObject = from;
        }
 public ApplyForTenantCommandHandler(
     IMapper mapper,
     IGuid guid,
     ITenantsRepository tenantsRepository,
     ITenantApplicationsRepository tenantApplicationsRepository)
 {
     _mapper                       = mapper;
     _guid                         = guid;
     _tenantsRepository            = tenantsRepository;
     _tenantApplicationsRepository = tenantApplicationsRepository;
 }
示例#19
0
 public ProcessReceiptHandler(
     IApplicationContext appContext,
     IDateTimeOffset dateTimeOffset,
     IFakturContext dbContext,
     IGuid guid
     )
 {
     this.appContext     = appContext ?? throw new ArgumentNullException(nameof(appContext));
     this.dateTimeOffset = dateTimeOffset ?? throw new ArgumentNullException(nameof(dateTimeOffset));
     this.dbContext      = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     this.guid           = guid ?? throw new ArgumentNullException(nameof(guid));
 }
示例#20
0
 public LogInHandler(
     IAuthenticationService authenticationService,
     IDateTimeOffset dateTimeOffset,
     IFakturContext dbContext,
     IGuid guid
     )
 {
     this.authenticationService = authenticationService ?? throw new ArgumentNullException(nameof(authenticationService));
     this.dateTimeOffset        = dateTimeOffset ?? throw new ArgumentNullException(nameof(dateTimeOffset));
     this.dbContext             = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     this.guid = guid ?? throw new ArgumentNullException(nameof(guid));
 }
示例#21
0
 public ProcessSuccessfulPaymentHandler(
     IMerchantEncryptionKeyGetter merchantEncryptionKeyGetter,
     IEncrypter encrypter,
     IPaymentRecordCreator paymentRecordCreator,
     IGuid guid,
     IDateTime dateTime)
 {
     _merchantEncryptionKeyGetter = merchantEncryptionKeyGetter;
     _encrypter            = encrypter;
     _paymentRecordCreator = paymentRecordCreator;
     _guid     = guid;
     _dateTime = dateTime;
 }
 public ProcessRejectedPaymentHandler(
     IEncrypter encrypter,
     IPaymentRecordCreator paymentRecordCreator,
     IGuid guid,
     IDateTime dateTime,
     IMerchantEncryptionKeyGetter merchantEncryptionKeyGetter)
 {
     _encrypter            = encrypter;
     _paymentRecordCreator = paymentRecordCreator;
     _guid     = guid;
     _dateTime = dateTime;
     _merchantEncryptionKeyGetter = merchantEncryptionKeyGetter;
 }
示例#23
0
 public SaveBannerHandler(
     IApplicationContext appContext,
     IDateTimeOffset dateTimeOffset,
     IFakturContext dbContext,
     IGuid guid,
     IMapper mapper
     )
 {
     this.appContext     = appContext ?? throw new ArgumentNullException(nameof(appContext));
     this.dateTimeOffset = dateTimeOffset ?? throw new ArgumentNullException(nameof(dateTimeOffset));
     this.dbContext      = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     this.guid           = guid ?? throw new ArgumentNullException(nameof(guid));
     this.mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
示例#24
0
 public ReactionService(IUnitOfWork unitOfWork,
                        IPhotoService photoService,
                        IPermissionsService permissionsService,
                        IClock clock,
                        IGuid guid,
                        IUserService userService)
 {
     _unitOfWork         = unitOfWork;
     _photoService       = photoService;
     _permissionsService = permissionsService;
     _clock       = clock;
     _guid        = guid;
     _userService = userService;
 }
示例#25
0
 public PhotoService(IFtpService ftpService,
                     IUnitOfWork unitOfWork,
                     IAlbumService albumService,
                     IClock clock,
                     IGuid guid,
                     IPermissionsService permissionsService)
 {
     _ftpService         = ftpService;
     _unitOfWork         = unitOfWork;
     _albumService       = albumService;
     _clock              = clock;
     _guid               = guid;
     _permissionsService = permissionsService;
 }
 public SaveNmedianHandler(
     IApplicationContext appContext,
     IDateTimeOffset dateTimeOffset,
     INmediaContext dbContext,
     IGuid guid,
     IMapper mapper
     )
 {
     _appContext     = appContext ?? throw new ArgumentNullException(nameof(appContext));
     _dateTimeOffset = dateTimeOffset ?? throw new ArgumentNullException(nameof(dateTimeOffset));
     _dbContext      = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     _guid           = guid ?? throw new ArgumentNullException(nameof(guid));
     _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
示例#27
0
 public TenantInitializer(
     IAdminTenantConfiguration adminTenantConfiguration,
     ITenantsRepository tenantsRepository,
     IMediator mediator,
     IGuid guid,
     IMapper mapper,
     ILogger <TenantInitializer> logger)
 {
     _adminTenantConfiguration = adminTenantConfiguration;
     _tenantsRepository        = tenantsRepository;
     _mediator = mediator;
     _guid     = guid;
     _mapper   = mapper;
     _logger   = logger;
 }
示例#28
0
    internal void Reset(IGuid secret, bool encrypted)
    {
        if (Values.ContainsKey(secret.Guid))
        {
            Values.Remove(secret.Guid);
        }

        var fileName = FileName(secret, false, encrypted);

        if (!File.Exists(fileName))
        {
            return;
        }

        File.Delete(fileName);
    }
示例#29
0
 public UserService(IUnitOfWork unitOfWork,
                    IEmailService emailService,
                    IClock clock,
                    IGuid guid,
                    IConstants constants,
                    IPasswordService passwordService,
                    IEncryptionService encryptionService)
 {
     _unitOfWork        = unitOfWork;
     _emailService      = emailService;
     _clock             = clock;
     _guid              = guid;
     _constants         = constants;
     _passwordService   = passwordService;
     _encryptionService = encryptionService;
 }
示例#30
0
 public PackageCreator(IFileSystem fileSystem, IGuid guid, IPackageFactory packageFactory, IConfigSettings configSettings,
                       IRepository <Package> packageRepository, IPackageAuthenticator packageAuthenticator, IHashGetter hashGetter,
                       IPackageIdValidator packageIdValidator, IPackageUriValidator packageUriValidator,
                       ILatestVersionChecker latestVersionChecker, ILatestVersionUpdater <Package> latestVersionUpdater)
 {
     _fileSystem           = fileSystem;
     _latestVersionUpdater = latestVersionUpdater;
     _latestVersionChecker = latestVersionChecker;
     _packageIdValidator   = packageIdValidator;
     _guid                 = guid;
     _packageFactory       = packageFactory;
     _configSettings       = configSettings;
     _packageRepository    = packageRepository;
     _packageAuthenticator = packageAuthenticator;
     _hashGetter           = hashGetter;
     _packageUriValidator  = packageUriValidator;
 }
示例#31
0
 public PackageCreator(IFileSystem fileSystem, IGuid guid, IPackageFactory packageFactory, IConfigSettings configSettings,
     IRepository<Package> packageRepository, IPackageAuthenticator packageAuthenticator, IHashGetter hashGetter,
     IPackageIdValidator packageIdValidator, IPackageUriValidator packageUriValidator,
     ILatestVersionChecker latestVersionChecker, ILatestVersionUpdater<Package> latestVersionUpdater)
 {
     _fileSystem = fileSystem;
     _latestVersionUpdater = latestVersionUpdater;
     _latestVersionChecker = latestVersionChecker;
     _packageIdValidator = packageIdValidator;
     _guid = guid;
     _packageFactory = packageFactory;
     _configSettings = configSettings;
     _packageRepository = packageRepository;
     _packageAuthenticator = packageAuthenticator;
     _hashGetter = hashGetter;
     _packageUriValidator = packageUriValidator;
 }