public static GetAllTextStepDataResponse GetAllTextSteps(GetAllTextStepDataRequest request) { GetAllTextStepDataResponse result = new GetAllTextStepDataResponse(); IStepRepository <GetAllTextStepDataResponse> repo = StepRepositoryFactory <GetAllTextStepDataResponse> .GetStepRepository(request.ContractNumber, request.Context, "text"); repo.UserId = request.UserId; result = repo.SelectAll() as GetAllTextStepDataResponse; return(result); }
public IEnumerable <object> SelectAll() { GetAllTextStepDataResponse response = new GetAllTextStepDataResponse(); List <DTO.TextData> list = new List <DTO.TextData>(); using (TextStepMongoContext ctx = new TextStepMongoContext(_dbName)) { var steps = (from s in ctx.TextSteps select new DTO.TextData { ID = s.Id.ToString(), Title = s.Text }).ToList(); response.Steps = steps; } return(response.Steps); }