func (c *WorkItemLinkTypeController) List(ctx *app.ListWorkItemLinkTypeContext) error {
	spaceID, err := uuid.FromString(ctx.ID)
	if err != nil {
		return errors.NewNotFoundError("spaceID", ctx.ID)
	}
	// WorkItemLinkTypeController_List: start_implement
	return application.Transactional(c.db, func(appl application.Application) error {
		modelLinkTypes, err := appl.WorkItemLinkTypes().List(ctx.Context, spaceID)
		if err != nil {
			jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
			return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
		}
		// convert to rest representation
		appLinkTypes := app.WorkItemLinkTypeList{}
		appLinkTypes.Data = make([]*app.WorkItemLinkTypeData, len(modelLinkTypes))
		for index, modelLinkType := range modelLinkTypes {
			appLinkType := ConvertWorkItemLinkTypeFromModel(ctx.RequestData, 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(spaceID, "%v"), obj)
		}
		linkCtx := newWorkItemLinkContext(ctx.Context, appl, c.db, ctx.RequestData, ctx.ResponseData, hrefFunc, nil)
		err = enrichLinkTypeList(linkCtx, &appLinkTypes)
		if err != nil {
			jerrors, _ := jsonapi.ErrorToJSONAPIErrors(goa.ErrInternal("Failed to enrich link types: %s", err.Error()))
			return ctx.InternalServerError(jerrors)
		}
		return ctx.OK(&appLinkTypes)
	})
	// WorkItemLinkTypeController_List: end_implement
}
// List runs the list action.
List runs the list action.
// List runs the list action .
func (c *WorkItemLinkTypeController) List(ctx *app.ListWorkItemLinkTypeContext) error {
	spaceID, err := uuid.FromString(ctx.ID)
	if err != nil {
		return errors.NewNotFoundError("spaceID", ctx.ID)
	}
	return application.Transactional(c.db, func(appl application.Application) error {
		modelLinkTypes, err := appl.WorkItemLinkTypes().List(ctx.Context, spaceID)
		if err != nil {
			jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
			return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
		}
		appLinkTypes := app.WorkItemLinkTypeList{}
		appLinkTypes.Data = make([]*app.WorkItemLinkTypeData, len(modelLinkTypes))
		for index, modelLinkType := range modelLinkTypes {
			appLinkType := ConvertWorkItemLinkTypeFromModel(ctx.RequestData, modelLinkType)
			appLinkTypes.Data[index] = appLinkType.Data
		}
		appLinkTypes.Meta = &app.WorkItemLinkTypeListMeta{
			TotalCount: len(modelLinkTypes),
		}
		hrefFunc := func(obj interface{}) string {
			return fmt.Sprintf(app.WorkItemLinkTypeHref(spaceID, "%v"), obj)
		}
		linkCtx := newWorkItemLinkContext(ctx.Context, appl, c.db, ctx.RequestData, ctx.ResponseData, hrefFunc, nil)
		err = enrichLinkTypeList(linkCtx, &appLinkTypes)
		if err != nil {
			jerrors, _ := jsonapi.ErrorToJSONAPIErrors(goa.ErrInternal("Failed to enrich link types: %s", err.Error()))
			return ctx.InternalServerError(jerrors)
		}
		return ctx.OK(&appLinkTypes)
	})
}
func ( c * WorkItemLinkTypeController ) List ( ctx * app . ListWorkItemLinkTypeContext ) error { spaceID , err := uuid . FromString ( ctx . ID ) if err != nil { return errors . NewNotFoundError ( " " , ctx . ID ) } return application . Transactional ( c . db , func ( appl application . Application ) error { modelLinkTypes , err := appl . WorkItemLinkTypes ( ) . List ( ctx . Context , spaceID ) if err != nil { jerrors , httpStatusCode := jsonapi . ErrorToJSONAPIErrors ( err ) return ctx . ResponseData . Service . Send ( ctx . Context , httpStatusCode , jerrors ) } appLinkTypes := app . WorkItemLinkTypeList { } appLinkTypes . Data = make ( [ ] * app . WorkItemLinkTypeData , len ( modelLinkTypes ) ) for index , modelLinkType := range modelLinkTypes { appLinkType := ConvertWorkItemLinkTypeFromModel ( ctx . RequestData , modelLinkType ) appLinkTypes . Data [ index ] = appLinkType . Data } appLinkTypes . Meta = & app . WorkItemLinkTypeListMeta { TotalCount : len ( modelLinkTypes ) , } hrefFunc := func ( obj interface { } ) string { return fmt . Sprintf ( app . WorkItemLinkTypeHref ( spaceID , " " ) , obj ) } linkCtx := newWorkItemLinkContext ( ctx . Context , appl , c . db , ctx . RequestData , ctx . ResponseData , hrefFunc , nil ) err = enrichLinkTypeList ( linkCtx , & appLinkTypes ) if err != nil { jerrors , _ := jsonapi . ErrorToJSONAPIErrors ( goa . ErrInternal ( " " , err . Error ( ) ) ) return ctx . InternalServerError ( jerrors ) } return ctx . OK ( & appLinkTypes ) } ) }
List runs the list action.
List runs the list action .
// WorkItemLinkTypeController_List: start_implement // convert to rest representation // TODO: When adding pagination, this must not be len(rows) but // the overall total number of elements from all pages. // Enrich // WorkItemLinkTypeController_List: end_implement