func (r *GormWorkItemRepository) List(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, start *int, limit *int) ([]WorkItem, uint64, error) {
	result, count, err := r.listItemsFromDB(ctx, spaceID, criteria, start, limit)
	if err != nil {
		return nil, 0, errs.WithStack(err)
	}
	res := make([]WorkItem, len(result))
	for index, value := range result {
		wiType, err := r.witr.LoadTypeFromDB(ctx, value.Type)
		if err != nil {
			return nil, 0, errors.NewInternalError(err.Error())
		}
		modelWI, err := ConvertWorkItemStorageToModel(wiType, &value)
		if err != nil {
			return nil, 0, errors.NewInternalError(err.Error())
		}
		res[index] = *modelWI
	}
	return res, count, nil
}
// List returns work item selected by the given criteria.Expression, starting with start (zero-based) and returning at most limit items
List returns work item selected by the given criteria.Expression, starting with start (zero-based) and returning at most limit items
// List returns work item selected by the given criteria . Expression starting with start ( zero - based ) and returning at most limit items
func (r *GormWorkItemRepository) List(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, start *int, limit *int) ([]WorkItem, uint64, error) {
	result, count, err := r.listItemsFromDB(ctx, spaceID, criteria, start, limit)
	if err != nil {
		return nil, 0, errs.WithStack(err)
	}
	res := make([]WorkItem, len(result))
	for index, value := range result {
		wiType, err := r.witr.LoadTypeFromDB(ctx, value.Type)
		if err != nil {
			return nil, 0, errors.NewInternalError(err.Error())
		}
		modelWI, err := ConvertWorkItemStorageToModel(wiType, &value)
		if err != nil {
			return nil, 0, errors.NewInternalError(err.Error())
		}
		res[index] = *modelWI
	}
	return res, count, nil
}
func ( r * GormWorkItemRepository ) List ( ctx context . Context , spaceID uuid . UUID , criteria criteria . Expression , start * int , limit * int ) ( [ ] WorkItem , uint64 , error ) { result , count , err := r . listItemsFromDB ( ctx , spaceID , criteria , start , limit ) if err != nil { return nil , 0 , errs . WithStack ( err ) } res := make ( [ ] WorkItem , len ( result ) ) for index , value := range result { wiType , err := r . witr . LoadTypeFromDB ( ctx , value . Type ) if err != nil { return nil , 0 , errors . NewInternalError ( err . Error ( ) ) } modelWI , err := ConvertWorkItemStorageToModel ( wiType , & value ) if err != nil { return nil , 0 , errors . NewInternalError ( err . Error ( ) ) } res [ index ] = * modelWI } return res , count , nil }
List returns work item selected by the given criteria.Expression, starting with start (zero-based) and returning at most limit items
List returns work item selected by the given criteria . Expression starting with start ( zero - based ) and returning at most limit items