重构存款预算
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 44s
Docker Build & Deploy / Deploy to Production (push) Has been skipped
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 3s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 44s
Docker Build & Deploy / Deploy to Production (push) Has been skipped
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 3s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s
This commit is contained in:
11
Common/IDateTimeProvider.cs
Normal file
11
Common/IDateTimeProvider.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Common;
|
||||
|
||||
public interface IDateTimeProvider
|
||||
{
|
||||
DateTime Now { get; }
|
||||
}
|
||||
|
||||
public class DateTimeProvider : IDateTimeProvider
|
||||
{
|
||||
public DateTime Now => DateTime.Now;
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public static class ServiceExtension
|
||||
/// </summary>
|
||||
public static IServiceCollection AddServices(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<IDateTimeProvider, DateTimeProvider>();
|
||||
// 扫描程序集
|
||||
var serviceAssembly = Assembly.Load("Service");
|
||||
var repositoryAssembly = Assembly.Load("Repository");
|
||||
|
||||
Reference in New Issue
Block a user