Base solution for your next web application

Activities of "tiny"

public override void PostInitialize()
        { 
            var uowManager = IocManager.Resolve<IUnitOfWorkManager>();
            using (uowManager.Begin())
            {
                using (var taskAppServices = IocManager.ResolveAsDisposable<ReportTasks.ReportTaskAppService>())
                {
                    taskAppServices.Object.RestoreAllTask();
                }
            }
        }
public void RestoreAllTask()
      {
            var tasks = _reportTaskRepository.GetAllList().MapTo<List<ReportTaskEditDto>>();

            foreach (var task in tasks)
            {
                //todo
            }
     }

Is there better way change my code? I dont want IocManager.Resolve<IUnitOfWorkManager>() here , but [UnitOfWork] not work

public override void PostInitialize()
  {   
            var uowManager = IocManager.Resolve<IUnitOfWorkManager>();
            using (uowManager.Begin())
            {
                using (var taskAppServices = IocManager.ResolveAsDisposable<ReportTasks.ReportTaskAppService>())
                {
                    taskAppServices.Object.RestoreAllTask();
                }
            }
    }
public void RestoreAllTask()
  {
            var tasks = _reportTaskRepository.GetAllList().MapTo<List<ReportTaskEditDto>>();

            foreach (var task in tasks)
            {
                //todo
            }
   }

Hi, is there other best way to do? if i dont want IocManager.Resolve<IUnitOfWorkManager>() here.
[UnitOfWork] not work for PostInitialize.

Showing 1 to 2 of 2 entries