Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Database
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
libraries
Database
Commits
8209a7ed
Commit
8209a7ed
authored
4 years ago
by
Benedikt Heinrichs
Browse files
Options
Downloads
Patches
Plain Diff
Fix resource creation
parent
231e5117
Branches
Topic/983-copyButton
No related tags found
1 merge request
!114
Topic/1286 dotnet5 database
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Database/Models/ResourceModel.cs
+2
-2
2 additions, 2 deletions
src/Database/Models/ResourceModel.cs
with
2 additions
and
2 deletions
src/Database/Models/ResourceModel.cs
+
2
−
2
View file @
8209a7ed
...
...
@@ -14,7 +14,7 @@ namespace Coscine.Database.Models
{
public
Resource
StoreFromObject
(
ResourceObject
resourceObject
)
{
if
(
resourceObject
.
Disciplines
.
Count
()
==
0
||
resourceObject
.
ResourceTypeOption
==
null
)
if
(
!
resourceObject
.
Disciplines
.
Any
()
||
resourceObject
.
ResourceTypeOption
==
null
)
{
throw
new
ArgumentException
(
"Discipline and ResourceTypeOption are necessary!"
);
}
...
...
@@ -27,7 +27,6 @@ namespace Coscine.Database.Models
Keywords
=
resourceObject
.
Keywords
,
UsageRights
=
resourceObject
.
UsageRights
,
TypeId
=
resourceObject
.
Type
.
Id
,
Type
=
new
ResourceTypeModel
().
GetById
(
resourceObject
.
Type
.
Id
),
VisibilityId
=
resourceObject
.
Visibility
.
Id
,
ApplicationProfile
=
resourceObject
.
ApplicationProfile
,
FixedValues
=
resourceObject
.
FixedValues
!=
null
?
resourceObject
.
FixedValues
.
ToString
()
:
"{}"
,
...
...
@@ -39,6 +38,7 @@ namespace Coscine.Database.Models
}
Insert
(
resource
);
resource
.
Type
=
new
ResourceTypeModel
().
GetById
(
resourceObject
.
Type
.
Id
);
try
{
SetDisciplines
(
resource
,
resourceObject
.
Disciplines
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment