code: func (c *WorkItemLinkTypesController) List(ctx *app.ListWorkItemLinkTypesContext) error {
  	var modelLinkTypes []link.WorkItemLinkType
  	err := application.Transactional(c.db, func(appl application.Application) error {
  		var err error
  		modelLinkTypes, err = appl.WorkItemLinkTypes().List(ctx.Context, ctx.SpaceTemplateID)
  		return err
  	})
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	}
  	return ctx.ConditionalEntities(modelLinkTypes, c.config.GetCacheControlWorkItemLinkTypes, func() error {
  		// convert to rest representation
  		appLinkTypes := app.WorkItemLinkTypeList{}
  		appLinkTypes.Data = make([]*app.WorkItemLinkTypeData, len(modelLinkTypes))
  		for index, modelLinkType := range modelLinkTypes {
  			appLinkType := ConvertWorkItemLinkTypeFromModel(ctx.Request, modelLinkType)
  			appLinkTypes.Data[index] = appLinkType.Data
  		}
  		// TODO: When adding pagination, this must not be len(rows) but
  		// the overall total number of elements from all pages.
  		appLinkTypes.Meta = &app.WorkItemLinkTypeListMeta{
  			TotalCount: len(modelLinkTypes),
  		}
  		// Enrich
  		HrefFunc := func(obj interface{}) string {
  			return fmt.Sprintf(app.WorkItemLinkTypeHref("%s"), obj)
  		}
  		err := application.Transactional(c.db, func(appl application.Application) error {
  			linkCtx := newWorkItemLinkContext(ctx.Context, ctx.Service, appl, c.db, ctx.Request, ctx.ResponseWriter, HrefFunc, nil)
  			return enrichLinkTypeList(linkCtx, &appLinkTypes)
  		})
  		if err != nil {
  			return errs.Wrap(err, "Failed to enrich link types")
  		}
  		return ctx.OK(&appLinkTypes)
  	})
  }
docs: // List runs the list action.