func (r *GormWorkItemRepository) Fetch(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (*WorkItem, error) {
	limit := 1
	results, count, err := r.List(ctx, spaceID, criteria, nil, &limit)
	if err != nil {
		return nil, err
	}
	// if no result
	if count == 0 {
		return nil, nil
	}
	// one result
	result := results[0]
	return &result, nil
}
// Fetch fetches the (first) work item matching by the given criteria.Expression.
Fetch fetches the (first) work item matching by the given criteria.Expression.
// Fetch fetches the ( first ) work item matching by the given criteria . Expression .
func (r *GormWorkItemRepository) Fetch(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (*WorkItem, error) {
	limit := 1
	results, count, err := r.List(ctx, spaceID, criteria, nil, &limit)
	if err != nil {
		return nil, err
	}
	if count == 0 {
		return nil, nil
	}
	result := results[0]
	return &result, nil
}
func ( r * GormWorkItemRepository ) Fetch ( ctx context . Context , spaceID uuid . UUID , criteria criteria . Expression ) ( * WorkItem , error ) { limit := 1 results , count , err := r . List ( ctx , spaceID , criteria , nil , & limit ) if err != nil { return nil , err } if count == 0 { return nil , nil } result := results [ 0 ] return & result , nil }
Fetch fetches the (first) work item matching by the given criteria.Expression.
Fetch fetches the ( first ) work item matching by the given criteria . Expression .
// if no result // one result