完成种子数据模块,完成服务替换模块
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Repositories;
|
||||
|
||||
namespace Yi.Framework.Uow
|
||||
{
|
||||
internal class DefaultUnitOfWork : IUnitOfWork
|
||||
{
|
||||
public DefaultUnitOfWork() { }
|
||||
public bool IsTran { get; set; }
|
||||
public bool IsCommit { get; set; }
|
||||
public bool IsClose { get; set; }
|
||||
|
||||
public bool Commit()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public IRepository<T> GetRepository<T>()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Uow
|
||||
{
|
||||
internal class DefaultUnitOfWorkManager : IUnitOfWorkManager
|
||||
{
|
||||
public IUnitOfWork CreateContext(bool isTran = true)
|
||||
{
|
||||
return new DefaultUnitOfWork();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using StartupModules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Yi.Framework.Ddd;
|
||||
|
||||
namespace Yi.Framework.Uow
|
||||
{
|
||||
[DependsOn(
|
||||
typeof(YiFrameworkDddModule))]
|
||||
public class YiFrameworkUowModule : IStartupModule
|
||||
{
|
||||
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
services.TryAddSingleton<IUnitOfWorkManager, DefaultUnitOfWorkManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user