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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
Project
Merge requests
!116
Sprint/2020 22
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Sprint/2020 22
Sprint/2020-22
into
master
Overview
0
Commits
8
Pipelines
5
Changes
18
Merged
Marcel Nellesen
requested to merge
Sprint/2020-22
into
master
4 years ago
Overview
0
Commits
8
Pipelines
5
Changes
18
Expand
0
0
Merge request reports
Compare
master
version 3
97ef4704
4 years ago
version 2
28d50265
4 years ago
version 1
ef257b5b
4 years ago
master (base)
and
latest version
latest version
ae853a96
8 commits,
4 years ago
version 3
97ef4704
7 commits,
4 years ago
version 2
28d50265
6 commits,
4 years ago
version 1
ef257b5b
3 commits,
4 years ago
18 files
+
419
−
126
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
18
Search (e.g. *.vue) (Ctrl+P)
src/Project/Controllers/DisciplineController.cs
+
13
−
1
Options
@@ -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