public GameService(IClockService _clockService) { cache = new MemoryCacheManager(); }
public CarToSmMapper(IClockService clockService) { _clockService = clockService; }
public static async Task <TPublication> PopulatePublicationAsync <TPublication>(this TPublication publication, IClockService clock, object newPublishedBy, CancellationToken cancellationToken = default) where TPublication : IObjectPublication { publication.NotNull(nameof(publication)); var newPublishedTime = await StoreHelper.GetDateTimeNowAsync(clock, publication.CreatedTimeType, cancellationToken).ConfigureAwait(); if (newPublishedTime.IsNotNull()) { await publication.SetObjectCreatedTimeAsync(newPublishedTime, cancellationToken) .ConfigureAwait(); await publication.SetObjectPublishedTimeAsync(newPublishedTime, cancellationToken) .ConfigureAwait(); } await publication.SetObjectCreatedByAsync(newPublishedBy, cancellationToken) .ConfigureAwait(); await publication.SetObjectPublishedByAsync(newPublishedBy, cancellationToken) .ConfigureAwait(); return(publication); }
public PaymentMethodToSavePaymentMethodMapper(IClockService clockService) => this.clockService = clockService;
public ValidateAccount2Module(IClockService clockService, IClassFactory classFactory) : base(clockService, classFactory) { }
public HumanInputToHumanMapper(IClockService clockService) => this.clockService = clockService;
/// <summary> /// 异步生成标识对象。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param> /// <returns>返回一个包含标识符对象的异步操作。</returns> public virtual async Task <object> GenerateObjectIdAsync(IClockService clock, CancellationToken cancellationToken = default) => await GenerateIdAsync(clock, cancellationToken).ConfigureAwait();
public override string GenerateId(IClockService clock) => GenerateId(clock, out _);
/// <summary> /// 异步生成标识。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param> /// <returns>返回一个包含 <typeparamref name="TId"/> 的异步操作。</returns> public abstract Task <TId> GenerateIdAsync(IClockService clock, CancellationToken cancellationToken = default);
/// <summary> /// 生成标识对象。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <returns>返回标识符对象。</returns> public virtual object GenerateObjectId(IClockService clock) => GenerateId(clock);
/// <summary> /// 生成标识。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <returns>返回 <typeparamref name="TId"/>。</returns> public abstract TId GenerateId(IClockService clock);
public MenuToSaveMenuMapper(IClockService clockService) => this.clockService = clockService;
/// <summary> /// Create a new instance of <see cref="ServiceClock"/>. /// </summary> /// <param name="clockService">The WCF client</param> public ServiceClock(IClockService clockService) { _clockService = clockService; }
/// <summary> /// 构造一个 <see cref="AbstractPortalStoreIdentificationGenerator{TId}"/>。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="factory">给定的 <see cref="IIdentificationGeneratorFactory"/>。</param> /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param> protected AbstractPortalStoreIdentificationGenerator(IClockService clock, IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory) : base(clock, factory, loggerFactory) { }
public CarToSaveCarTranslator(IClockService clockService) => this.clockService = clockService;
public Clock(IClockService clock) { _clock = clock; }
public ContactUsToSaveContactUsMapper(IClockService clockService) { _clockService = clockService; }
/// <summary> /// 异步生成标识。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param> /// <returns>返回一个包含字符串的异步操作。</returns> public override async Task <string> GenerateIdAsync(IClockService clock, CancellationToken cancellationToken = default) => await GenerateIdDescriptorAsync(clock, cancellationToken).ConfigureAwait();
public bool IsBreakTime(IClockService clockService) { var now = clockService.Now(); return(now - _lessonStartDateTime > new TimeSpan(1, 30, 00)); }
public ExampleStoreIdentifierGenerator(IClockService clock, IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory) : base(clock, factory, loggerFactory) { }
public SlideContentToSaveSlideContentMapper(IClockService clockService) =>
protected AccountingModuleBase(IClockService clockService, IClassFactory classFactory) { ClockService = clockService; ClassFactory = classFactory; }
public SystemSettingGroupToSaveSystemSettingGroupMapper(IClockService clockService) =>
public CentresService(ICentresDataService centresDataService, IClockService clockService) { this.centresDataService = centresDataService; this.clockService = clockService; }
public DatabaseService(IServiceResolver serviceResolver, IConfiguratorService configuratorService, IClockService clockService) { this.serviceResolver = serviceResolver; this.configuratorService = configuratorService; this.clockService = clockService; }
public UserRepository(IdentityEntities context, IContextService env) : base(context) { _clock = new ClockService(env); }
/// <summary> /// 构造一个 <see cref="GuidContentStoreIdentificationGenerator"/>。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="factory">给定的 <see cref="IIdentificationGeneratorFactory"/>。</param> /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param> public GuidContentStoreIdentificationGenerator(IClockService clock, IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory) : base(clock, factory, loggerFactory) { }
/// <summary> /// 构造一个 <see cref="StringPortalStoreIdentificationGenerator"/>。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="factory">给定的 <see cref="IIdentificationGeneratorFactory"/>。</param> /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param> public StringPortalStoreIdentificationGenerator(IClockService clock, IIdentificationGeneratorFactory factory, ILoggerFactory loggerFactory) : base(clock, factory, loggerFactory) { }
/// <summary> /// 异步生成标识。 /// </summary> /// <param name="clock">给定的 <see cref="IClockService"/>。</param> /// <param name="cancellationToken">给定的 <see cref="CancellationToken"/>(可选)。</param> /// <returns>返回一个包含字符串的异步操作。</returns> public virtual Task <MonggoIdentificationDescriptor> GenerateIdDescriptorAsync(IClockService clock, CancellationToken cancellationToken = default) => cancellationToken.RunOrCancelAsync(() => { var timestamp = GetTimestamp(clock); var buffer = ComputeHex(timestamp); return(MonggoIdentificationDescriptor.Create(buffer)); });
private static int GetTimestamp(IClockService clock) { var ts = clock.GetNow() - ExtensionSettings.Preference.UnixEpoch; return(Convert.ToInt32(Math.Floor(ts.TotalSeconds))); }
public CarToSaveCarMapper(IClockService clockService) => this.clockService = clockService;
public ClockStoreViewModel(IClockService clockService) { _clockService = clockService; }