Skip to content

Commit 5b598a3

Browse files
committed
feat(ci): first pass at gitlab ci
1 parent c4a3cbe commit 5b598a3

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

.gitlab-ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
stages:
2+
- build
3+
4+
before_script:
5+
- 'dotnet restore'
6+
7+
build:
8+
stage: build
9+
script:
10+
- 'dotnet pack ./src/JsonApiDotNetCore -c Release -o ./artifacts'
11+
- 'mono NuGet.exe push ./artifacts/*.nupkg %NugetAPIKey% -Source %NugetSource%'
12+
only:
13+
- master

CONTRIBUTING.MD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
## Workflow
4+
5+
1. Search through the issues to see if your particular issue has already been discovered and possibly addressed
6+
2. Open an issue if you can't find anything helpful
7+
3. Open a PR for proposed changes
8+
9+
## Commit Guidelines
10+
11+
I have chosen to loosely follow the [Angular Commit Guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit)

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@
1313
- [x] Refactor relationships links to use an POCO that contains data and links objects
1414
- [x] Include Entities
1515
- [x] BadRequest should be 422 in POST
16+
- [x] Dasherized route support
17+
- [x] Contributing Guide
18+
- [ ] Pagination
1619
- [ ] Add integration tests to example project
1720
- [ ] Add logging
1821
- [ ] Configure Different Repositories
19-
- [ ] Contributing Guide
2022
- [ ] Build definitions
2123
- [ ] Tests
2224
- [ ] Allow for presenters with mappings
2325
- [ ] Ability to disable dasherization of names
24-
- [ ] Dasherized route support
25-
- [ ] Sorting/Filtering should be handled by the repository so that it is not dependeny on EF ?
2626
- [ ] Rename ContextEntity ??
2727

28-
2928
## Usage
3029

3130
- Add Middleware

src/JsonApiDotNetCore/Controllers/JsonApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public virtual async Task<IActionResult> GetRelationshipsAsync(TId id, string re
101101
public virtual async Task<IActionResult> GetRelationshipAsync(TId id, string relationshipName)
102102
{
103103
relationshipName = _jsonApiContext.ContextGraph
104-
.GetRelationshipName<T>(relationshipName);
104+
.GetRelationshipName<T>(relationshipName.ToProperCase());
105105

106106
if (relationshipName == null)
107107
return UnprocessableEntity();

src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ public virtual IQueryable<TEntity> Sort(IQueryable<TEntity> entities, List<SortQ
7575

7676
public virtual async Task<TEntity> GetAsync(TId id)
7777
{
78-
return await _dbSet.FirstOrDefaultAsync(e => e.Id.Equals(id));
78+
return await _dbSet.SingleOrDefaultAsync(e => e.Id.Equals(id));
7979
}
8080

8181
public virtual async Task<TEntity> GetAndIncludeAsync(TId id, string relationshipName)
8282
{
8383
return await _dbSet
8484
.Include(relationshipName)
85-
.FirstOrDefaultAsync(e => e.Id.Equals(id));
85+
.SingleOrDefaultAsync(e => e.Id.Equals(id));
8686
}
8787

8888
public virtual async Task<TEntity> CreateAsync(TEntity entity)

0 commit comments

Comments
 (0)