Exemplo n.º 1
0
 public GatewayService(IMediator mediator, ICountryService country, ITimezoneService timezone)
 {
     _mediator = mediator;
     _country  = country;
     _timezone = timezone;
     _language = new Language(CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
 }
 public AccountInfoEventHandler(IAccountRepository repository, ICountryService country,
                                ITimezoneService timezone, IIpAddressHasher ipAddressHasher)
 {
     _repository      = repository;
     _country         = country;
     _timezone        = timezone;
     _ipAddressHasher = ipAddressHasher;
 }
 public TimezoneApiController(
     IMapper mapper,
     ITimezoneService timezoneService,
     ILoginUserRepository loginUserRepository
     ) : base(mapper, loginUserRepository)
 {
     _timezoneService = timezoneService;
 }
 public CommandService(ISubscriberService subscriberService,
                       ITelegramBotClient telegramBotClient,
                       IMapper mapper,
                       IWeatherService weatherService,
                       ISubscriberSettingsService subscriberSettingsService,
                       ITimezoneService timezoneService,
                       IGeoCodeService geoCodeService)
 {
     this._subscriberService         = subscriberService;
     this._telegramBotClient         = telegramBotClient;
     this._mapper                    = mapper;
     this._weatherService            = weatherService;
     this._subscriberSettingsService = subscriberSettingsService;
     this._timezoneService           = timezoneService;
     this._geoCodeService            = geoCodeService;
 }
        public UpdateProfileCommandValidator(ITimezoneService timezone, ICountryService country)
        {
            RuleFor(x => x.Bio)
            .MaximumLength(260);

            RuleFor(x => x.DateOfBirth)
            .NotEmpty()
            .Must(x => x < DateTime.UtcNow);

            RuleFor(x => x.City)
            .MaximumLength(100);

            RuleFor(x => x.Gender)
            .IsInEnum();

            RuleFor(x => x.Language)
            .NotEmpty()
            .Must(x => Language.TryParse(x, out _));

            RuleFor(x => x.Nickname)
            .NotEmpty()
            .MinimumLength(3)
            .MaximumLength(100);

            RuleFor(x => x.FirstName)
            .MaximumLength(100);

            RuleFor(x => x.LastName)
            .MaximumLength(100);

            RuleFor(x => x.Timezone)
            .NotEmpty()
            .MustAsync(async(value, ct) => await timezone.GetAsync(value, ct) is not null);

            RuleFor(x => x.CountryCode)
            .NotEmpty()
            .MustAsync(async(value, ct) => await country.GetAsync(value, ct) is not null);

            RuleFor(x => x.City)
            .NotNull();
        }
Exemplo n.º 6
0
 public UpdateProfileCommandHandler(IAccountRepository repository, ITimezoneService timezone)
 {
     _repository = repository;
     _timezone   = timezone;
 }
 public TimezoneController(ITimezoneService timezoneService)
 {
     _timezoneService = timezoneService;
 }
Exemplo n.º 8
0
 public UserSettingsController(IStringLocalizer <UserSettingsController> localizer, ITimezoneService timezoneService, IUserService userService)
 {
     this.localizer       = localizer;
     this.timezoneService = timezoneService;
     this.userService     = userService;
 }