Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .idea/.idea.JsonApiDotNetCore.MongoDb/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ dotnet: 3.1.100
solution: JsonApiDotNetCore.MongoDb.sln
services:
- mongodb
before_script:
- sleep 15
script:
- dotnet restore
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./coverage/lcov-coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- dotnet build -c Release
- dotnet pack -c Release
deploy:
skip_cleanup: true
provider: script
script: dotnet nuget push ./src/JsonApiDotNetCore.MongoDb/bin/Release/JsonApiDotNetCore.MongoDb.*.nupkg -k $NUGET_API -s https://api.nuget.org/v3/index.json
on:
branch: master
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Alvaro Nicoli

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# JsonApiDotNetCore MongoDB Repository

[![NuGet version][nuget-image]][nuget-url]
[![Downloads][downloads-image]][nuget-url]
[![Build Status](https://travis-ci.com/mrnkr/JsonApiDotNetCore.MongoDb.svg?branch=master)](https://travis-ci.com/mrnkr/JsonApiDotNetCore.MongoDb)
[![codecov](https://codecov.io/gh/mrnkr/JsonApiDotNetCore.MongoDb/branch/master/graph/badge.svg)](https://codecov.io/gh/mrnkr/JsonApiDotNetCore.MongoDb)
[![license][license]](https://github.com/mrnkr/JsonApiDotNetCore.MongoDb/blob/master/LICENSE)

[nuget-image]:https://img.shields.io/nuget/v/JsonApiDotNetCore.MongoDb
[nuget-url]:https://www.nuget.org/packages/JsonApiDotNetCore.MongoDb
[downloads-image]:https://img.shields.io/nuget/dt/JsonApiDotNetCore.MongoDb
[license]:https://img.shields.io/github/license/mrnkr/JsonApiDotNetCore.MongoDb

Plug-n-play implementation of `IResourceRepository<TResource, TId>` allowing you to use MongoDb with your `JsonApiDotNetCore` APIs.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>4.0.0</VersionPrefix>
<VersionPrefix>4.0.0-beta1</VersionPrefix>
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<PackageTags>jsonapi;json:api;dotnet;core;mongodb</PackageTags>
<Description>Persistence layer implementation for use of mongodb in applications using JsonApiDotNetCore</Description>
<PackageProjectUrl>https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb</PackageProjectUrl>
<PackageProjectUrl>https://github.com/mrnkr/JsonApiDotNetCore.MongoDb</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public QueryableBuilder(Expression source, Type elementType, Type extensionType,

public Expression ApplyQuery(QueryLayer layer)
{
layer = layer ?? throw new ArgumentNullException(nameof(layer));

Expression expression = _source;
var expression = _source;

if (layer.Filter != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,49 +82,46 @@ FNDA:26,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Int
DA:38,26
DA:39,26
DA:41,26
DA:43,26
DA:42,14
DA:43,14
DA:44,14
DA:45,14
DA:46,14
DA:48,26
DA:46,26
DA:47,12
DA:48,12
DA:49,12
DA:50,12
DA:51,12
DA:53,26
DA:51,26
DA:52,12
DA:53,12
DA:54,12
DA:55,12
DA:56,12
DA:58,26
DA:59,26
BRDA:39,3,0,0
BRDA:39,3,1,26
BRDA:43,37,0,14
BRDA:43,37,1,26
BRDA:48,66,0,12
BRDA:48,66,1,26
BRDA:53,95,0,12
BRDA:53,95,1,26
FN:61,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyFilter(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.FilterExpression)
DA:56,26
DA:57,26
BRDA:41,19,0,14
BRDA:41,19,1,26
BRDA:46,48,0,12
BRDA:46,48,1,26
BRDA:51,77,0,12
BRDA:51,77,1,26
FN:59,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyFilter(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.FilterExpression)
FNDA:14,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyFilter(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.FilterExpression)
DA:62,14
DA:60,14
DA:61,14
DA:63,14
DA:64,14
DA:65,14
DA:66,14
DA:67,14
FN:69,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplySort(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.SortExpression)
FN:67,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplySort(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.SortExpression)
FNDA:12,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplySort(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.SortExpression)
DA:70,12
DA:68,12
DA:69,12
DA:71,12
DA:72,12
DA:73,12
DA:74,12
DA:75,12
FN:77,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyPagination(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.PaginationExpression)
FN:75,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyPagination(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.PaginationExpression)
FNDA:12,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyPagination(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.PaginationExpression)
DA:78,12
DA:76,12
DA:77,12
DA:79,12
DA:80,12
DA:81,12
DA:82,12
DA:83,12
FN:23,System.Void JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::.ctor(System.Linq.Expressions.Expression,System.Type,System.Type,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaParameterNameFactory,JsonApiDotNetCore.Resources.IResourceFactory,JsonApiDotNetCore.Configuration.IResourceContextProvider,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScopeFactory)
FNDA:26,System.Void JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::.ctor(System.Linq.Expressions.Expression,System.Type,System.Type,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaParameterNameFactory,JsonApiDotNetCore.Resources.IResourceFactory,JsonApiDotNetCore.Configuration.IResourceContextProvider,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScopeFactory)
DA:24,26
Expand Down Expand Up @@ -153,10 +150,10 @@ BRDA:33,124,0,0
BRDA:33,124,1,26
BRDA:34,147,0,26
BRDA:34,147,1,26
LF:44
LH:44
BRF:22
BRH:15
LF:43
LH:43
BRF:20
BRH:14
FNF:5
FNH:5
end_of_record
Expand Down Expand Up @@ -245,20 +242,20 @@ FNH:3
end_of_record
SF:/Users/mrnkr/Documents/code/JsonApiDotNetCore.MongoDb/src/Example/Models/Book.cs
FN:12,System.String Example.Models.Book::get_Id()
FNDA:1470,System.String Example.Models.Book::get_Id()
DA:13,1470
FNDA:1481,System.String Example.Models.Book::get_Id()
DA:13,1481
FN:15,System.String Example.Models.Book::get_Name()
FNDA:936,System.String Example.Models.Book::get_Name()
DA:16,936
FNDA:942,System.String Example.Models.Book::get_Name()
DA:16,942
FN:19,System.Decimal Example.Models.Book::get_Price()
FNDA:1184,System.Decimal Example.Models.Book::get_Price()
DA:20,1184
FNDA:1187,System.Decimal Example.Models.Book::get_Price()
DA:20,1187
FN:22,System.String Example.Models.Book::get_Category()
FNDA:906,System.String Example.Models.Book::get_Category()
DA:23,906
FNDA:912,System.String Example.Models.Book::get_Category()
DA:23,912
FN:25,System.String Example.Models.Book::get_Author()
FNDA:906,System.String Example.Models.Book::get_Author()
DA:26,906
FNDA:912,System.String Example.Models.Book::get_Author()
DA:26,912
FN:28,System.String Example.Models.Book::get_StringId()
FNDA:0,System.String Example.Models.Book::get_StringId()
DA:29,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,49 +82,46 @@ FNDA:0,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Inte
DA:38,0
DA:39,0
DA:41,0
DA:42,0
DA:43,0
DA:44,0
DA:45,0
DA:46,0
DA:47,0
DA:48,0
DA:49,0
DA:50,0
DA:51,0
DA:52,0
DA:53,0
DA:54,0
DA:55,0
DA:56,0
DA:58,0
DA:59,0
BRDA:39,3,0,0
BRDA:39,3,1,0
BRDA:43,37,0,0
BRDA:43,37,1,0
BRDA:48,66,0,0
BRDA:48,66,1,0
BRDA:53,95,0,0
BRDA:53,95,1,0
FN:61,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyFilter(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.FilterExpression)
DA:57,0
BRDA:41,19,0,0
BRDA:41,19,1,0
BRDA:46,48,0,0
BRDA:46,48,1,0
BRDA:51,77,0,0
BRDA:51,77,1,0
FN:59,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyFilter(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.FilterExpression)
FNDA:0,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyFilter(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.FilterExpression)
DA:62,0
DA:60,0
DA:61,0
DA:63,0
DA:64,0
DA:65,0
DA:66,0
DA:67,0
FN:69,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplySort(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.SortExpression)
FN:67,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplySort(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.SortExpression)
FNDA:0,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplySort(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.SortExpression)
DA:70,0
DA:68,0
DA:69,0
DA:71,0
DA:72,0
DA:73,0
DA:74,0
DA:75,0
FN:77,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyPagination(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.PaginationExpression)
FN:75,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyPagination(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.PaginationExpression)
FNDA:0,System.Linq.Expressions.Expression JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::ApplyPagination(System.Linq.Expressions.Expression,JsonApiDotNetCore.Queries.Expressions.PaginationExpression)
DA:78,0
DA:76,0
DA:77,0
DA:79,0
DA:80,0
DA:81,0
DA:82,0
DA:83,0
FN:23,System.Void JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::.ctor(System.Linq.Expressions.Expression,System.Type,System.Type,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaParameterNameFactory,JsonApiDotNetCore.Resources.IResourceFactory,JsonApiDotNetCore.Configuration.IResourceContextProvider,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScopeFactory)
FNDA:0,System.Void JsonApiDotNetCore.MongoDb.Queries.Internal.QueryableBuilding.QueryableBuilder::.ctor(System.Linq.Expressions.Expression,System.Type,System.Type,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaParameterNameFactory,JsonApiDotNetCore.Resources.IResourceFactory,JsonApiDotNetCore.Configuration.IResourceContextProvider,JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScopeFactory)
DA:24,0
Expand Down Expand Up @@ -153,9 +150,9 @@ BRDA:33,124,0,0
BRDA:33,124,1,0
BRDA:34,147,0,0
BRDA:34,147,1,0
LF:44
LF:43
LH:0
BRF:22
BRF:20
BRH:0
FNF:5
FNH:0
Expand Down