Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
Coscine
backend
apis
Project
Merge requests
!118
Product/932 docu project api
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Product/932 docu project api
Product/932-docuProjectApi
into
Sprint/2020-22
Overview
0
Commits
2
Pipelines
1
Changes
14
Merged
Product/932 docu project api
Marcel Nellesen
requested to merge
Product/932-docuProjectApi
into
Sprint/2020-22
Dec 3, 2020
Overview
0
Commits
2
Pipelines
1
Changes
14
coscine/issues#932
0
0
Merge request reports
Compare
Sprint/2020-22
Sprint/2020-22 (base)
and
latest version
latest version
d7317f08
2 commits,
Dec 3, 2020
14 files
+
293
−
41
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
src/Project/Controllers/DisciplineController.cs
+
13
−
1
View file @ d7317f08
Edit in single-file editor
Open in Web IDE
Show full file
@@ -2,22 +2,34 @@
using
Coscine.Database.ReturnObjects
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
Coscine.Api.Project.Controllers
{
/// <summary>
/// This controller represents the actions which can be taken with a discipline object.
/// </summary>
[
Authorize
]
public
class
DisciplineController
:
Controller
{
private
readonly
DisciplineModel
_disciplineModel
;
/// <summary>
/// DisciplineController constructor specifying a DisciplineModel
/// </summary>
public
DisciplineController
()
{
_disciplineModel
=
new
DisciplineModel
();
}
/// <summary>
/// Returns all available disciplines
/// </summary>
/// <returns>All Disciplines</returns>
[
Route
(
"[controller]"
)]
public
I
ActionResult
Index
()
public
ActionResult
<
IEnumerable
<
DisciplineObject
>>
Index
()
{
return
Json
(
_disciplineModel
.
GetAll
()
.
OrderBy
(
discipline
=>
discipline
.
DisplayNameDe
.
Substring
(
discipline
.
DisplayNameDe
.
Length
-
3
))
Loading