public override async Task <StateTask> Get(Guid id)
 {
     return(await StateManagementContext
            .Set <StateTask>()
            .Include(x => x.Flow)
            .Include(x => x.State)
            .FirstOrDefaultAsync(x => x.Id == id));
 }
 public async Task <List <State> > GetByFlowId(Guid flowId)
 {
     return(await StateManagementContext
            .Set <State>()
            .Include(x => x.Flow)
            .Where(x => x.FlowId == flowId)
            .ToListAsync());
 }
 public async Task <List <StateTask> > GetTasksByStateId(Guid stateId)
 {
     return(await StateManagementContext
            .Set <StateTask>()
            .Include(x => x.Flow)
            .Include(x => x.State)
            .Where(x => x.StateId == stateId)
            .ToListAsync());
 }
 public UnitOfWork(
     IFlowRepository flowRepository,
     IStateRepository stateRepository,
     ITaskRepository taskRepository,
     StateManagementContext stateManagementContext)
 {
     FlowRepository          = flowRepository;
     StateRepository         = stateRepository;
     _stateManagementContext = stateManagementContext;
     TaskRepository          = taskRepository;
 }
Пример #5
0
 public FlowRepository(StateManagementContext stateManagementContext)
     : base(stateManagementContext)
 {
 }
Пример #6
0
 protected EfRepository(StateManagementContext stateManagementContext)
 {
     this.StateManagementContext = stateManagementContext;
 }
 public async Task <State> GetFirstStateByFlowId(Guid flowId)
 {
     return(await StateManagementContext
            .Set <State>()
            .FirstOrDefaultAsync(x => x.FlowId == flowId && x.PrevStateId == null));
 }