Repository: BlueshiftSoftware/EntityFrameworkCore
Branch: develop
Commit: 69cfc1c3772f
Files: 200
Total size: 700.6 KB
Directory structure:
gitextract_yaxh7ovu/
├── .dockerignore
├── .gitattributes
├── .gitignore
├── .travis.yml
├── Blueshift.EntityFrameworkCore.sln
├── Blueshift.EntityFrameworkCore.sln.DotSettings
├── Directory.Build.props
├── Directory.Build.targets
├── LICENSE.txt
├── NuGet.config
├── README.md
├── appveyor.yml
├── build/
│ ├── dependencies.props
│ ├── repo.beforecommon.props
│ ├── repo.props
│ ├── repo.targets
│ └── sources.props
├── build.cmd
├── build.sh
├── docker-compose.dcproj
├── docker-compose.yml
├── korebuild-lock.txt
├── korebuild.json
├── run.cmd
├── run.ps1
├── run.sh
├── src/
│ ├── Blueshift.EntityFrameworkCore.MongoDB/
│ │ ├── Adapter/
│ │ │ ├── Conventions/
│ │ │ │ ├── AbstractBaseClassConvention.cs
│ │ │ │ ├── BsonClassMapAttributeConvention.cs
│ │ │ │ ├── BsonMemberMapAttributeConvention.cs
│ │ │ │ ├── IgnoreEmptyEnumerablesConvention.cs
│ │ │ │ ├── IgnoreNullOrEmptyStringsConvention.cs
│ │ │ │ ├── KeyAttributeConvention.cs
│ │ │ │ ├── NavigationSrializationMemberMapConvention.cs
│ │ │ │ └── NotMappedAttributeConvention.cs
│ │ │ ├── EntityFrameworkConventionPack.cs
│ │ │ ├── Serialization/
│ │ │ │ ├── BsonSerializerExtensions.cs
│ │ │ │ ├── DenormalizingBsonClassMapSerializer.cs
│ │ │ │ └── NavigationBsonMemberMapSerializer.cs
│ │ │ └── Update/
│ │ │ ├── DeleteOneModelFactory.cs
│ │ │ ├── IMongoDbWriteModelFactory.cs
│ │ │ ├── IMongoDbWriteModelFactoryCache.cs
│ │ │ ├── IMongoDbWriteModelFactorySelector.cs
│ │ │ ├── InsertOneModelFactory.cs
│ │ │ ├── MongoDbWriteModelFactory.cs
│ │ │ ├── MongoDbWriteModelFactoryCache.cs
│ │ │ ├── MongoDbWriteModelFactorySelector.cs
│ │ │ └── ReplaceOneModelFactory.cs
│ │ ├── Annotations/
│ │ │ ├── DenormalizeAttribute.cs
│ │ │ ├── MongoCollectionAttribute.cs
│ │ │ └── MongoDatabaseAttribute.cs
│ │ ├── Blueshift.EntityFrameworkCore.MongoDB.csproj
│ │ ├── ChangeTracking/
│ │ │ └── MongoDbInternalEntityEntryFactory.cs
│ │ ├── DbContextOptionsExtensions.cs
│ │ ├── DependencyInjection/
│ │ │ └── MongoDbEfServiceCollectionExtensions.cs
│ │ ├── Infrastructure/
│ │ │ ├── EntityFrameworkMongoDbServicesBuilder.cs
│ │ │ ├── MongoDbContextOptionsBuilder.cs
│ │ │ ├── MongoDbContextOptionsBuilderExtensions.cs
│ │ │ ├── MongoDbModelValidator.cs
│ │ │ └── MongoDbOptionsExtension.cs
│ │ ├── ListExtensions.cs
│ │ ├── Metadata/
│ │ │ ├── Builders/
│ │ │ │ ├── DocumentDbInternalMetadataBuilderExtensions.cs
│ │ │ │ ├── DocumentEntityTypeBuilderExtensions.cs
│ │ │ │ ├── DocumentInternalKeyBuilderExtensions.cs
│ │ │ │ ├── MongoDbConventionSetBuilder.cs
│ │ │ │ ├── MongoDbConventionSetBuilderDependencies.cs
│ │ │ │ ├── MongoDbEntityTypeBuilderExtensions.cs
│ │ │ │ ├── MongoDbInternalMetadataBuilderExtensions.cs
│ │ │ │ └── MongoDbModelBuilderExtensions.cs
│ │ │ ├── Conventions/
│ │ │ │ ├── BsonDiscriminatorAttributeConvention.cs
│ │ │ │ ├── BsonIgnoreAttributeConvention.cs
│ │ │ │ ├── BsonKnownTypesAttributeConvention.cs
│ │ │ │ ├── BsonRequiredAttributeConvention.cs
│ │ │ │ ├── DocumentPropertyMappingValidationConvention.cs
│ │ │ │ ├── MongoCollectionAttributeConvention.cs
│ │ │ │ ├── MongoDatabaseConvention.cs
│ │ │ │ ├── MongoDbDatabaseGeneratedAttributeConvention.cs
│ │ │ │ ├── MongoDbKeyAttributeConvention.cs
│ │ │ │ ├── MongoDbRelationshipDiscoveryConvention.cs
│ │ │ │ └── OwnedDocumentConvention.cs
│ │ │ ├── DocumentAnnotationNames.cs
│ │ │ ├── DocumentAnnotations.cs
│ │ │ ├── DocumentEntityTypeAnnotations.cs
│ │ │ ├── DocumentKeyAnnotations.cs
│ │ │ ├── MongoDbAnnotationNames.cs
│ │ │ ├── MongoDbEntityTypeAnnotations.cs
│ │ │ └── MongoDbModelAnnotations.cs
│ │ ├── MethodHelper.cs
│ │ ├── MongoDbUtilities.cs
│ │ ├── ObjectIdTypeConverter.cs
│ │ ├── Properties/
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Blueshift.EntityFrameworkCore.MongoDB.rd.xml
│ │ │ ├── DocumentDbStrings.Designer.cs
│ │ │ ├── DocumentDbStrings.cs
│ │ │ ├── DocumentDbStrings.resx
│ │ │ └── DocumentDbStrings.tt
│ │ ├── Query/
│ │ │ ├── EntityLoadInfoFactory.cs
│ │ │ ├── ExpressionVisitors/
│ │ │ │ ├── DocumentNavigationRewritingExpressionVisitor.cs
│ │ │ │ ├── DocumentNavigationRewritingExpressionVisitorFactory.cs
│ │ │ │ ├── IMongoDbDenormalizedCollectionCompensatingVisitorFactory.cs
│ │ │ │ ├── MongoDbDenormalizedCollectionCompensatingVisitor.cs
│ │ │ │ ├── MongoDbDenormalizedCollectionCompensatingVisitorFactory.cs
│ │ │ │ ├── MongoDbEntityQueryableExpressionVisitor.cs
│ │ │ │ ├── MongoDbEntityQueryableExpressionVisitorFactory.cs
│ │ │ │ ├── MongoDbMemberAccessBindingExpressionVisitor.cs
│ │ │ │ └── MongoDbMemberAccessBindingExpressionVisitorFactory.cs
│ │ │ ├── Expressions/
│ │ │ │ ├── DocumentQueryExpression.cs
│ │ │ │ ├── IDocumentQueryExpressionFactory.cs
│ │ │ │ └── MongoDbDocumentQueryExpressionFactory.cs
│ │ │ ├── IEntityLoadInfoFactory.cs
│ │ │ ├── IValueBufferFactory.cs
│ │ │ ├── LinqQueryCompilationContextFactory.cs
│ │ │ ├── MongoDbEntityQueryModelVisitor.cs
│ │ │ ├── MongoDbEntityQueryModelVisitorDependencies.cs
│ │ │ ├── MongoDbEntityQueryModelVisitorFactory.cs
│ │ │ ├── MongoDbQueryBuffer.cs
│ │ │ ├── MongoDbQueryContext.cs
│ │ │ ├── MongoDbQueryContextFactory.cs
│ │ │ ├── QueryableLinqOperatorProvider.cs
│ │ │ └── ValueBufferFactory.cs
│ │ ├── Storage/
│ │ │ ├── IMongoDbConnection.cs
│ │ │ ├── IMongoDbTypeMappingSource.cs
│ │ │ ├── MongoDbConnection.cs
│ │ │ ├── MongoDbDatabase.cs
│ │ │ ├── MongoDbDatabaseCreator.cs
│ │ │ └── MongoDbTypeMappingSource.cs
│ │ └── ValueGeneration/
│ │ ├── HashCodeValueGenerator.cs
│ │ ├── IntegerValueGenerator.cs
│ │ ├── MongoDbValueGeneratorSelector.cs
│ │ └── ObjectIdValueGenerator.cs
│ ├── Blueshift.EntityFrameworkCore.MongoDB.SampleDomain/
│ │ ├── Blueshift.EntityFrameworkCore.MongoDB.SampleDomain.csproj
│ │ ├── ZooDbContext.cs
│ │ ├── ZooDbDependencyInjection.cs
│ │ ├── ZooEntityFixture.cs
│ │ └── _Comparers.cs
│ ├── Blueshift.Identity.MongoDB/
│ │ ├── Blueshift.Identity.MongoDB.csproj
│ │ ├── DependencyInjection/
│ │ │ └── IdentityEntityFrameworkMongoDbBuilderExtensions.cs
│ │ ├── IdentityMongoDbContext.cs
│ │ ├── MongoDbIdentityClaim.cs
│ │ ├── MongoDbIdentityRole.cs
│ │ ├── MongoDbIdentityUser.cs
│ │ ├── MongoDbIdentityUserLogin.cs
│ │ ├── MongoDbIdentityUserRole.cs
│ │ ├── MongoDbIdentityUserToken.cs
│ │ ├── MongoDbRoleStore.cs
│ │ └── MongoDbUserStore.cs
│ ├── Directory.Build.props
│ └── Shared/
│ ├── Check.cs
│ ├── CodeAnnotations.cs
│ ├── MemberInfoExtensions.cs
│ ├── PropertyInfoExtensions.cs
│ ├── SharedTypeExtensions.cs
│ └── StringBuilderExtensions.cs
├── test/
│ ├── Blueshift.EntityFrameworkCore.MongoDB.Tests/
│ │ ├── Adapter/
│ │ │ ├── Conventions/
│ │ │ │ ├── AbstractClassConventionTest.cs
│ │ │ │ ├── IgnoreEmptyEnumerablesConventionTests.cs
│ │ │ │ ├── IgnoreNullOrEmptyStringsConventionTests.cs
│ │ │ │ └── KeyAttributeConventionTests.cs
│ │ │ ├── EntityFrameworkConventionPackTests.cs
│ │ │ ├── Serialization/
│ │ │ │ ├── BsonSerializerExtensionsTests.cs
│ │ │ │ └── DenormalizingBsonClassMapSerializerTests.cs
│ │ │ └── Update/
│ │ │ └── MongoDbWriteModelFactoryTests.cs
│ │ ├── ApiConsistencyTest.cs
│ │ ├── Blueshift.EntityFrameworkCore.MongoDB.Tests.csproj
│ │ ├── Metadata/
│ │ │ ├── Conventions/
│ │ │ │ └── MongoDatabaseConventionTests.cs
│ │ │ ├── MongoDbEntityTypeAnnotationsTests.cs
│ │ │ └── MongoDbModelAnnotationsTests.cs
│ │ ├── MongoDbContextTestBase.cs
│ │ ├── MongoDbContextTests.cs
│ │ ├── MongoDbUtilitiesTests.cs
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── Storage/
│ │ │ ├── MongoDbConnectionTests.cs
│ │ │ ├── MongoDbDatabaseCreatorTests.cs
│ │ │ ├── MongoDbDatabaseTests.cs
│ │ │ └── MongoDbTypeMappingSourceTests.cs
│ │ ├── ValueGeneration/
│ │ │ ├── MongoDbValueGeneratorSelectorTests.cs
│ │ │ └── ObjectIdValueGeneratorTests.cs
│ │ └── xunit.runner.json
│ ├── Blueshift.Identity.MongoDB.Tests/
│ │ ├── Blueshift.Identity.MongoDB.Tests.csproj
│ │ ├── MongoDbIdentityFixture.cs
│ │ ├── MongoDbIdentityTestBase.cs
│ │ ├── MongoDbIdentityTestCollection.cs
│ │ ├── MongoDbRoleClaimStoreTests.cs
│ │ ├── MongoDbRoleStoreTests.cs
│ │ ├── MongoDbUserAuthenticationTokenStoreTests.cs
│ │ ├── MongoDbUserAuthenticatorKeyStoreTests.cs
│ │ ├── MongoDbUserClaimStoreTests.cs
│ │ ├── MongoDbUserEmailStoreTests.cs
│ │ ├── MongoDbUserLockoutStoreTests.cs
│ │ ├── MongoDbUserLoginStoreTests.cs
│ │ ├── MongoDbUserPasswordStoreTests.cs
│ │ ├── MongoDbUserPhoneNumberStoreTests.cs
│ │ ├── MongoDbUserRoleStoreTests.cs
│ │ ├── MongoDbUserSecurityStampStoreTests.cs
│ │ ├── MongoDbUserStoreTests.cs
│ │ ├── MongoDbUserTwoFactorRecoveryCodeStoreTests.cs
│ │ ├── MongoDbUserTwoFactorStoreTests.cs
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── _Comparers.cs
│ │ └── xunit.runner.json
│ └── Directory.Build.props
└── version.props
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
.dockerignore
.env
.git
.gitignore
.vs
.vscode
docker-compose.yml
docker-compose.*.yml
*/bin
*/obj
================================================
FILE: .gitattributes
================================================
* text=auto
*.sh text eol=lf
================================================
FILE: .gitignore
================================================
/.build/
/global.json
QueryBaseline.cs
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
*.user.sln*
/test.ps1
*.stackdump
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# BenchmarkDotNet Results
[Bb]enchmarkDotNet.Artifacts/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
test/Microsoft.EntityFrameworkCore.MongoDB.Tests/.data/
================================================
FILE: .travis.yml
================================================
language: csharp
sudo: false
dotnet: 2.1.2
dist: trusty
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
mono: none
services:
- mongodb
os:
- linux
# - osx
osx_image: xcode8.1
addons:
apt:
packages:
- libunwind8
branches:
only:
- master
- release
- develop
- /^rel\/.*/
- /^(.*\/)?ci-.*$/
script:
- ./build.sh
================================================
FILE: Blueshift.EntityFrameworkCore.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FAF9C31C-A1AF-42A9-9306-EC190DCACCC7}"
ProjectSection(SolutionItems) = preProject
build\dependencies.props = build\dependencies.props
build\repo.beforecommon.props = build\repo.beforecommon.props
build\repo.props = build\repo.props
build\repo.targets = build\repo.targets
build\sources.props = build\sources.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Globals", "Globals", "{6841D576-C833-4614-89D8-4CF4DECD1CFA}"
ProjectSection(SolutionItems) = preProject
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
build.cmd = build.cmd
build.sh = build.sh
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
global.json = global.json
korebuild-lock.txt = korebuild-lock.txt
korebuild.json = korebuild.json
NuGet.config = NuGet.config
README.md = README.md
run.cmd = run.cmd
run.ps1 = run.ps1
run.sh = run.sh
version.props = version.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{258D5057-81B9-40EC-A872-D21E27452749}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{2B598BE4-9107-4F65-90E7-749F3A41F9D6}"
ProjectSection(SolutionItems) = preProject
src\Shared\Check.cs = src\Shared\Check.cs
src\Shared\CodeAnnotations.cs = src\Shared\CodeAnnotations.cs
src\Shared\MemberInfoExtensions.cs = src\Shared\MemberInfoExtensions.cs
src\Shared\PropertyInfoExtensions.cs = src\Shared\PropertyInfoExtensions.cs
src\Shared\SharedTypeExtensions.cs = src\Shared\SharedTypeExtensions.cs
src\Shared\StringBuilderExtensions.cs = src\Shared\StringBuilderExtensions.cs
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blueshift.EntityFrameworkCore.MongoDB", "src\Blueshift.EntityFrameworkCore.MongoDB\Blueshift.EntityFrameworkCore.MongoDB.csproj", "{E0841FBC-A266-41BF-AA5F-4514692D2161}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blueshift.EntityFrameworkCore.MongoDB.SampleDomain", "src\Blueshift.EntityFrameworkCore.MongoDB.SampleDomain\Blueshift.EntityFrameworkCore.MongoDB.SampleDomain.csproj", "{169261F6-0B97-47A5-98B8-E6AA084FF6A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blueshift.EntityFrameworkCore.MongoDB.Tests", "test\Blueshift.EntityFrameworkCore.MongoDB.Tests\Blueshift.EntityFrameworkCore.MongoDB.Tests.csproj", "{314B80D1-CBB7-4EF5-A5BD-3AD9F14069E8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blueshift.Identity.MongoDB", "src\Blueshift.Identity.MongoDB\Blueshift.Identity.MongoDB.csproj", "{85A1B2BB-BF46-445A-85C3-CFB1CCCB33CE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blueshift.Identity.MongoDB.Tests", "test\Blueshift.Identity.MongoDB.Tests\Blueshift.Identity.MongoDB.Tests.csproj", "{E7AF1BE9-6017-4FDF-BDEC-B3FAC1888A25}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{04CEB217-71E2-4DBD-B35A-737EE7D258B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E0841FBC-A266-41BF-AA5F-4514692D2161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0841FBC-A266-41BF-AA5F-4514692D2161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0841FBC-A266-41BF-AA5F-4514692D2161}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0841FBC-A266-41BF-AA5F-4514692D2161}.Release|Any CPU.Build.0 = Release|Any CPU
{169261F6-0B97-47A5-98B8-E6AA084FF6A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{169261F6-0B97-47A5-98B8-E6AA084FF6A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{169261F6-0B97-47A5-98B8-E6AA084FF6A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{169261F6-0B97-47A5-98B8-E6AA084FF6A4}.Release|Any CPU.Build.0 = Release|Any CPU
{314B80D1-CBB7-4EF5-A5BD-3AD9F14069E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{314B80D1-CBB7-4EF5-A5BD-3AD9F14069E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{314B80D1-CBB7-4EF5-A5BD-3AD9F14069E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{314B80D1-CBB7-4EF5-A5BD-3AD9F14069E8}.Release|Any CPU.Build.0 = Release|Any CPU
{85A1B2BB-BF46-445A-85C3-CFB1CCCB33CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85A1B2BB-BF46-445A-85C3-CFB1CCCB33CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85A1B2BB-BF46-445A-85C3-CFB1CCCB33CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85A1B2BB-BF46-445A-85C3-CFB1CCCB33CE}.Release|Any CPU.Build.0 = Release|Any CPU
{E7AF1BE9-6017-4FDF-BDEC-B3FAC1888A25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7AF1BE9-6017-4FDF-BDEC-B3FAC1888A25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7AF1BE9-6017-4FDF-BDEC-B3FAC1888A25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7AF1BE9-6017-4FDF-BDEC-B3FAC1888A25}.Release|Any CPU.Build.0 = Release|Any CPU
{04CEB217-71E2-4DBD-B35A-737EE7D258B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04CEB217-71E2-4DBD-B35A-737EE7D258B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04CEB217-71E2-4DBD-B35A-737EE7D258B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04CEB217-71E2-4DBD-B35A-737EE7D258B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2B598BE4-9107-4F65-90E7-749F3A41F9D6} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}
{E0841FBC-A266-41BF-AA5F-4514692D2161} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}
{169261F6-0B97-47A5-98B8-E6AA084FF6A4} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}
{314B80D1-CBB7-4EF5-A5BD-3AD9F14069E8} = {258D5057-81B9-40EC-A872-D21E27452749}
{85A1B2BB-BF46-445A-85C3-CFB1CCCB33CE} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}
{E7AF1BE9-6017-4FDF-BDEC-B3FAC1888A25} = {258D5057-81B9-40EC-A872-D21E27452749}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AA7DD3E1-6124-4D69-A1C3-E4D643A5C4D5}
EndGlobalSection
EndGlobal
================================================
FILE: Blueshift.EntityFrameworkCore.sln.DotSettings
================================================
True
================================================
FILE: Directory.Build.props
================================================
$([System.DateTime]::Now.ToString('yyyy'))
git
$(MSBuildThisFileDirectory)
https://github.com/crhairr/EntityFrameworkCore.MongoDb.git
True
Blueshift Software, LLC
$(Company)
© $(Company) @ $(BuildYear) - all rights reserved.
Blueshift;MongoDB;Entity Framework Core;entity-framework-core;EF;Data;O/RM
Blueshift Software MongoDB Provider for Entity Framework Core
full
7.2
$(NoWarn);CS8032;
$(MSBuildProjectName)
$(MSBuildProjectName)
================================================
FILE: Directory.Build.targets
================================================
$(MicrosoftNETCoreApp20PackageVersion)
$(NETStandardLibrary20PackageVersion)
99.9
================================================
FILE: LICENSE.txt
================================================
Copyright (c) 2017 Blueshift Software, LLC. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
================================================
FILE: NuGet.config
================================================
================================================
FILE: README.md
================================================
This repository has been defunct for some time. Due to a lack of both public interest and general support from the Microsoft Entity Framework team, I have decided to formally end support for the solution and archive the repository.
# Document Database Providers for Entity Framework Core
Welcome to the home of Document Database (NoSQL) Providers for EntityFrameworkCore!
[](https://ci.appveyor.com/project/crhairr/entityframeworkcore-mongodb/) [](https://travis-ci.org/BlueshiftSoftware/EntityFrameworkCore)
This repository currently only contains a MongoDB provider for EF Core. However, there are plans in the current roadmap to expand this with further NoSQL provider offerings.
MongoDb is a highly popular No-SQL database solution for storing structured, non-relational document data. This provider enables applications built with EntityFrameworkCore to use MongoDb instances as a backing data store.
Find out how to get started by visiting the [Wiki pages](https://github.com/crhairr/EntityFrameworkCore.MongoDb/wiki). Feel free to contribute to this repository with code, comments, wiki entries, and/or issues.
The latest release and CI previews builds are available at the EntityFrameworkCore.MongoDb [MyGet Feed](https://www.myget.org/gallery/efcore-mongodb/).
================================================
FILE: appveyor.yml
================================================
init:
- git config --global core.autocrlf true
clone_depth: 1
test: off
services:
- mongodb
environment:
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
matrix:
fast_finish: true
for:
-
matrix:
only:
- image: Ubuntu
build_script:
- sh: chmod +x ./run.sh
- sh: ./run.sh default-build
-
matrix:
only:
- image: Visual Studio 2017
build_script:
- ps: .\run.ps1 default-build
artifacts:
- path: 'artifacts\build\*.nupkg'
name: MyGet
deploy:
- provider: Environment
name: MyGet
artifact: 'artifacts\build\*.nupkg'
on:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
image:
- Ubuntu
- Visual Studio 2017
================================================
FILE: build/dependencies.props
================================================
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
2.1.1
2.0.3
2.1.3
2.1.2
2.1.2
2.1.1
2.7.3
15.9.0
4.10.1
2.4.1
2.4.1
2.4.1
================================================
FILE: build/repo.beforecommon.props
================================================
true
================================================
FILE: build/repo.props
================================================
False
true
================================================
FILE: build/repo.targets
================================================
================================================
FILE: build/sources.props
================================================
$(DotNetRestoreSources)
$(RestoreSources);
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
https://www.myget.org/F/efcore-mongodb/api/v3/index.json;
$(RestoreSources);
https://api.nuget.org/v3/index.json;
================================================
FILE: build.cmd
================================================
@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE"
================================================
FILE: build.sh
================================================
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
chmod +x "$DIR/run.sh"; sync
"$DIR/run.sh" default-build "$@"
================================================
FILE: docker-compose.dcproj
================================================
2.1
Linux
04ceb217-71e2-4dbd-b35a-737ee7d258b8
LaunchBrowser
{Scheme}://localhost:{ServicePort}
blueshift.authoring
================================================
FILE: docker-compose.yml
================================================
version: '3.4'
services:
mongo-efcore:
image: mongo:4.1.2-xenial
restart: always
ports:
- 27017:27017
mongo-efcore-express:
image: mongo-express
restart: always
ports:
- 27027:8081
environment:
ME_CONFIG_MONGODB_SERVER: mongo-efcore
================================================
FILE: korebuild-lock.txt
================================================
version:2.1.3-rtm-15802
commithash:a7c08b45b440a7d2058a0aa1eaa3eb6ba811976a
================================================
FILE: korebuild.json
================================================
{
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json",
"channel": "release/2.1"
}
================================================
FILE: run.cmd
================================================
@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE"
================================================
FILE: run.ps1
================================================
#!/usr/bin/env powershell
#requires -version 4
<#
.SYNOPSIS
Executes KoreBuild commands.
.DESCRIPTION
Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`.
.PARAMETER Command
The KoreBuild command to run.
.PARAMETER Path
The folder to build. Defaults to the folder containing this script.
.PARAMETER Channel
The channel of KoreBuild to download. Overrides the value from the config file.
.PARAMETER DotNetHome
The directory where .NET Core tools will be stored.
.PARAMETER ToolsSource
The base url where build tools can be downloaded. Overrides the value from the config file.
.PARAMETER Update
Updates KoreBuild to the latest version even if a lock file is present.
.PARAMETER Reinstall
Re-installs KoreBuild
.PARAMETER ConfigFile
The path to the configuration file that stores values. Defaults to korebuild.json.
.PARAMETER ToolsSourceSuffix
The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores.
.PARAMETER CI
Sets up CI specific settings and variables.
.PARAMETER Arguments
Arguments to be passed to the command
.NOTES
This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be.
When the lockfile is not present, KoreBuild will create one using latest available version from $Channel.
The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set
in the file are overridden by command line parameters.
.EXAMPLE
Example config file:
```json
{
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json",
"channel": "dev",
"toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools"
}
```
#>
[CmdletBinding(PositionalBinding = $false)]
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Command,
[string]$Path = $PSScriptRoot,
[Alias('c')]
[string]$Channel,
[Alias('d')]
[string]$DotNetHome,
[Alias('s')]
[string]$ToolsSource,
[Alias('u')]
[switch]$Update,
[switch]$Reinstall,
[string]$ToolsSourceSuffix,
[string]$ConfigFile = $null,
[switch]$CI,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$Arguments
)
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
#
# Functions
#
function Get-KoreBuild {
$lockFile = Join-Path $Path 'korebuild-lock.txt'
if (!(Test-Path $lockFile) -or $Update) {
Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix
}
$version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1
if (!$version) {
Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'"
}
$version = $version.TrimStart('version:').Trim()
$korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version)
if ($Reinstall -and (Test-Path $korebuildPath)) {
Remove-Item -Force -Recurse $korebuildPath
}
if (!(Test-Path $korebuildPath)) {
Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version"
New-Item -ItemType Directory -Path $korebuildPath | Out-Null
$remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip"
try {
$tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip"
Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix
if (Get-Command -Name 'Microsoft.PowerShell.Archive\Expand-Archive' -ErrorAction Ignore) {
# Use built-in commands where possible as they are cross-plat compatible
Microsoft.PowerShell.Archive\Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath
}
else {
# Fallback to old approach for old installations of PowerShell
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath)
}
}
catch {
Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore
throw
}
finally {
Remove-Item $tmpfile -ErrorAction Ignore
}
}
return $korebuildPath
}
function Join-Paths([string]$path, [string[]]$childPaths) {
$childPaths | ForEach-Object { $path = Join-Path $path $_ }
return $path
}
function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) {
if ($RemotePath -notlike 'http*') {
Copy-Item $RemotePath $LocalPath
return
}
$retries = 10
while ($retries -gt 0) {
$retries -= 1
try {
Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath
return
}
catch {
Write-Verbose "Request failed. $retries retries remaining"
}
}
Write-Error "Download failed: '$RemotePath'."
}
#
# Main
#
# Load configuration or set defaults
$Path = Resolve-Path $Path
if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' }
if (Test-Path $ConfigFile) {
try {
$config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json
if ($config) {
if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel }
if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource}
}
}
catch {
Write-Warning "$ConfigFile could not be read. Its settings will be ignored."
Write-Warning $Error[0]
}
}
if (!$DotNetHome) {
$DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } `
elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} `
elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}`
else { Join-Path $PSScriptRoot '.dotnet'}
}
if (!$Channel) { $Channel = 'dev' }
if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' }
# Execute
$korebuildPath = Get-KoreBuild
Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')
try {
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile -CI:$CI
Invoke-KoreBuildCommand $Command @Arguments
}
finally {
Remove-Module 'KoreBuild' -ErrorAction Ignore
}
================================================
FILE: run.sh
================================================
#!/usr/bin/env bash
set -euo pipefail
#
# variables
#
RESET="\033[0m"
RED="\033[0;31m"
YELLOW="\033[0;33m"
MAGENTA="\033[0;95m"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet"
verbose=false
update=false
reinstall=false
repo_path="$DIR"
channel=''
tools_source=''
tools_source_suffix=''
ci=false
#
# Functions
#
__usage() {
echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]"
echo ""
echo "Arguments:"
echo " command The command to be run."
echo " ... Arguments passed to the command. Variable number of arguments allowed."
echo ""
echo "Options:"
echo " --verbose Show verbose output."
echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.."
echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json."
echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet."
echo " --path The directory to build. Defaults to the directory containing the script."
echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file."
echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings."
echo " -u|--update Update to the latest KoreBuild even if the lock file is present."
echo " --reinstall Reinstall KoreBuild."
echo " --ci Apply CI specific settings and environment variables."
echo ""
echo "Description:"
echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be."
echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel."
if [[ "${1:-}" != '--no-exit' ]]; then
exit 2
fi
}
get_korebuild() {
local version
local lock_file="$repo_path/korebuild-lock.txt"
if [ ! -f "$lock_file" ] || [ "$update" = true ]; then
__get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix"
fi
version="$(grep 'version:*' -m 1 "$lock_file")"
if [[ "$version" == '' ]]; then
__error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'"
return 1
fi
version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version"
if [ "$reinstall" = true ] && [ -d "$korebuild_path" ]; then
rm -rf "$korebuild_path"
fi
{
if [ ! -d "$korebuild_path" ]; then
mkdir -p "$korebuild_path"
local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip"
tmpfile="$(mktemp)"
echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}"
if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then
unzip -q -d "$korebuild_path" "$tmpfile"
fi
rm "$tmpfile" || true
fi
source "$korebuild_path/KoreBuild.sh"
} || {
if [ -d "$korebuild_path" ]; then
echo "Cleaning up after failed installation"
rm -rf "$korebuild_path" || true
fi
return 1
}
}
__error() {
echo -e "${RED}error: $*${RESET}" 1>&2
}
__warn() {
echo -e "${YELLOW}warning: $*${RESET}"
}
__machine_has() {
hash "$1" > /dev/null 2>&1
return $?
}
__get_remote_file() {
local remote_path=$1
local local_path=$2
local remote_path_suffix=$3
if [[ "$remote_path" != 'http'* ]]; then
cp "$remote_path" "$local_path"
return 0
fi
local failed=false
if __machine_has wget; then
wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true
else
failed=true
fi
if [ "$failed" = true ] && __machine_has curl; then
failed=false
curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true
fi
if [ "$failed" = true ]; then
__error "Download failed: $remote_path" 1>&2
return 1
fi
}
#
# main
#
command="${1:-}"
shift
while [[ $# -gt 0 ]]; do
case $1 in
-\?|-h|--help)
__usage --no-exit
exit 0
;;
-c|--channel|-Channel)
shift
channel="${1:-}"
[ -z "$channel" ] && __usage
;;
--config-file|-ConfigFile)
shift
config_file="${1:-}"
[ -z "$config_file" ] && __usage
if [ ! -f "$config_file" ]; then
__error "Invalid value for --config-file. $config_file does not exist."
exit 1
fi
;;
-d|--dotnet-home|-DotNetHome)
shift
DOTNET_HOME="${1:-}"
[ -z "$DOTNET_HOME" ] && __usage
;;
--path|-Path)
shift
repo_path="${1:-}"
[ -z "$repo_path" ] && __usage
;;
-s|--tools-source|-ToolsSource)
shift
tools_source="${1:-}"
[ -z "$tools_source" ] && __usage
;;
--tools-source-suffix|-ToolsSourceSuffix)
shift
tools_source_suffix="${1:-}"
[ -z "$tools_source_suffix" ] && __usage
;;
-u|--update|-Update)
update=true
;;
--reinstall|-[Rr]einstall)
reinstall=true
;;
--ci)
ci=true
;;
--verbose|-Verbose)
verbose=true
;;
--)
shift
break
;;
*)
break
;;
esac
shift
done
if ! __machine_has unzip; then
__error 'Missing required command: unzip'
exit 1
fi
if ! __machine_has curl && ! __machine_has wget; then
__error 'Missing required command. Either wget or curl is required.'
exit 1
fi
[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json"
if [ -f "$config_file" ]; then
if __machine_has jq ; then
if jq '.' "$config_file" >/dev/null ; then
config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
else
__warn "$config_file is invalid JSON. Its settings will be ignored."
fi
elif __machine_has python ; then
if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then
config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else
__warn "$config_file is invalid JSON. Its settings will be ignored."
fi
else
__warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.'
fi
[ ! -z "${config_channel:-}" ] && channel="$config_channel"
[ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source"
fi
[ -z "$channel" ] && channel='dev'
[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
get_korebuild
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci"
invoke_korebuild_command "$command" "$@"
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/AbstractBaseClassConvention.cs
================================================
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
///
///
/// A convention that specifies that a discriminator is required when the given type is abstract.
///
public class AbstractBaseClassConvention : BsonClassMapAttributeConvention
{
///
///
/// Process the conventions on according to the given .
///
/// The to which the conventions will be assigned.
/// The that defines the convention.
protected override void Apply(BsonClassMap classMap, BsonKnownTypesAttribute attribute)
{
Check.NotNull(classMap, nameof(classMap));
if (!classMap.DiscriminatorIsRequired)
{
classMap.SetDiscriminatorIsRequired(classMap.ClassType.IsAbstract);
}
}
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/BsonClassMapAttributeConvention.cs
================================================
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
///
///
/// Base class for attribute-based convention processing.
///
/// The type of attribute to process.
public abstract class BsonClassMapAttributeConvention : ConventionBase, IClassMapConvention
where TAttribute : Attribute
{
///
///
/// Initializes a new instance of the .
///
protected BsonClassMapAttributeConvention()
: base(Regex.Replace(typeof(TAttribute).Name, "Attribute$", ""))
{
}
///
///
/// Processes each defined on the given
/// member info and
///
/// The to
public virtual void Apply(BsonClassMap classMap)
{
Check.NotNull(classMap, nameof(classMap));
IEnumerable memberMapAttributes = classMap
.ClassType
.GetCustomAttributes();
foreach (TAttribute attribute in memberMapAttributes)
{
Apply(classMap, attribute);
}
}
///
/// Process the conventions on according to the given .
///
/// The to which the conventions will be assigned.
/// The that defines the convention.
protected abstract void Apply([NotNull] BsonClassMap classMap, [NotNull] TAttribute attribute);
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/BsonMemberMapAttributeConvention.cs
================================================
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
/// Base class for attribute-based convention processing.
///
/// The type of attribute to process.
public abstract class BsonMemberMapAttributeConvention : ConventionBase, IMemberMapConvention
where TAttribute : Attribute
{
///
/// Initializes a new instance of the .
///
protected BsonMemberMapAttributeConvention()
: base(Regex.Replace(typeof(TAttribute).Name, "Attribute$", ""))
{
}
///
/// Processes each defined on the given
/// member info and
///
/// The to
public virtual void Apply([NotNull] BsonMemberMap memberMap)
{
Check.NotNull(memberMap, nameof(memberMap));
IEnumerable memberMapAttributes = memberMap.MemberInfo
.GetCustomAttributes();
foreach (TAttribute attribute in memberMapAttributes)
{
Apply(memberMap, attribute);
}
}
///
/// Process the conventions on according to the given .
///
/// The to which the conventions will be assigned.
/// The that defines the convention.
protected abstract void Apply([NotNull] BsonMemberMap memberMap, [NotNull] TAttribute attribute);
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/IgnoreEmptyEnumerablesConvention.cs
================================================
using System;
using System.Collections;
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
/// A convention that ignores empty instances when serializing Bson documents.
///
public class IgnoreEmptyEnumerablesConvention : ConventionBase, IMemberMapConvention
{
///
/// Initializes a new instance of the class.
///
public IgnoreEmptyEnumerablesConvention()
: base(Regex.Replace(nameof(IgnoreEmptyEnumerablesConvention), "Convention$", ""))
{
}
///
/// Applies the Ignore Empty Enumerables convention to the given .
///
/// The to which the convention will be applied.
public virtual void Apply([NotNull] BsonMemberMap memberMap)
{
Check.NotNull(memberMap, nameof(memberMap));
if (memberMap.MemberType.TryGetSequenceType() != null)
{
memberMap.SetShouldSerializeMethod(@object =>
{
object value = memberMap.Getter(@object);
return (value as IEnumerable)?.GetEnumerator().MoveNext() ?? false;
});
}
}
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/IgnoreNullOrEmptyStringsConvention.cs
================================================
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
/// Instructs the MongoDb C# driver to ignore null, empty, or default values of properties.
///
public class IgnoreNullOrEmptyStringsConvention : ConventionBase, IMemberMapConvention
{
///
/// Initializes a new instance of the class.
///
public IgnoreNullOrEmptyStringsConvention()
: base(Regex.Replace(nameof(IgnoreNullOrEmptyStringsConvention), "Convention$", ""))
{
}
///
/// Applies the Ignore Null or Empty Strings convention to the given .
///
/// The to which the convention will be applied.
public virtual void Apply([NotNull] BsonMemberMap memberMap)
{
Check.NotNull(memberMap, nameof(memberMap));
if (memberMap.MemberType == typeof(string))
{
SetShouldSerializeMethod(memberMap);
}
}
private static void SetShouldSerializeMethod(BsonMemberMap memberMap)
{
var defaultString = memberMap.DefaultValue as string;
if (!string.IsNullOrEmpty(defaultString))
{
ShouldSerializeIfNotDefault(memberMap, defaultString);
}
else
{
ShouldSerializeIfNotEmpty(memberMap);
}
}
private static void ShouldSerializeIfNotEmpty(BsonMemberMap memberMap)
=> memberMap.SetShouldSerializeMethod(@object => !string.IsNullOrEmpty(memberMap.Getter(@object) as string));
private static void ShouldSerializeIfNotDefault(BsonMemberMap memberMap, string defaultString)
=> memberMap.SetShouldSerializeMethod(@object => !string.Equals(defaultString, memberMap.Getter(@object) as string));
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/KeyAttributeConvention.cs
================================================
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
/// A convention that sets the of a
/// if that property has been decorated with a .
///
public class KeyAttributeConvention : BsonMemberMapAttributeConvention
{
///
/// Applies the Key Attribute convention to the given .
///
/// The to which the convention will be applied.
/// The to apply.
protected override void Apply(BsonMemberMap memberMap, KeyAttribute attribute)
=> Check.NotNull(memberMap, nameof(memberMap))
.ClassMap
.SetIdMember(memberMap);
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/NavigationSrializationMemberMapConvention.cs
================================================
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using Blueshift.EntityFrameworkCore.MongoDB.Adapter.Serialization;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
///
///
/// A convention for specifying how to serialize navigation properties.
///
public class NavigationSrializationMemberMapConvention : ConventionBase, IMemberMapConvention
{
///
///
/// Checks whether the member map represents a navigation, and sets the member map's serializer.
///
/// The member map.
public void Apply(BsonMemberMap memberMap)
{
Type memberTargetType = Check.NotNull(memberMap, nameof(memberMap)).MemberType.TryGetSequenceType()
?? memberMap.MemberType;
if (!memberTargetType.IsPrimitive && HasIdMember(memberTargetType))
{
IBsonSerializer memberMapSerializer = (IBsonSerializer) Activator.CreateInstance(
typeof(NavigationBsonMemberMapSerializer<>).MakeGenericType(memberTargetType),
memberMap);
memberMap.SetSerializer(memberMapSerializer);
}
}
private bool HasIdMember(Type type)
=> !type.IsPrimitive
&& type
.GetMembers(BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.Instance)
.Any(memberInfo => memberInfo.IsDefined(typeof(BsonIdAttribute))
|| memberInfo.IsDefined(typeof(KeyAttribute)));
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Conventions/NotMappedAttributeConvention.cs
================================================
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions
{
///
/// Marks a as ignored during serialization.
///
public class NotMappedAttributeConvention : BsonMemberMapAttributeConvention
{
///
/// Applies the Not Mapped convention to the given .
///
/// The to which the convention will be applied.
/// The to apply.
protected override void Apply(BsonMemberMap memberMap, NotMappedAttribute attribute)
=> Check.NotNull(memberMap, nameof(memberMap))
.ClassMap
.UnmapMember(memberMap.MemberInfo);
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/EntityFrameworkConventionPack.cs
================================================
using System;
using Blueshift.EntityFrameworkCore.MongoDB.Adapter.Conventions;
using MongoDB.Bson.Serialization.Conventions;
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter
{
///
///
/// Provides a set of conventions that configures the MongoDb C# Driver to work appropriately with the EntityFrameworkCore.
///
public class EntityFrameworkConventionPack : ConventionPack
{
///
/// Registers the .
///
///
public static void Register(Func typeFilter)
{
ConventionRegistry.Register(
"Blueshift.EntityFrameworkCore.MongoDb.Conventions",
Instance,
typeFilter);
}
///
/// The singleton instance of .
///
public static EntityFrameworkConventionPack Instance { get; } = new EntityFrameworkConventionPack();
private EntityFrameworkConventionPack()
{
AddRange(new IConvention[]
{
new AbstractBaseClassConvention(),
new KeyAttributeConvention(),
new NavigationSrializationMemberMapConvention(),
new NotMappedAttributeConvention()
});
}
}
}
================================================
FILE: src/Blueshift.EntityFrameworkCore.MongoDB/Adapter/Serialization/BsonSerializerExtensions.cs
================================================
using System;
using System.Collections.Generic;
using System.Reflection;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Utilities;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Serializers;
// ReSharper disable once CheckNamespace
namespace Blueshift.EntityFrameworkCore.MongoDB.Adapter.Serialization
{
///
/// Provides extended functionality to .
///
public static class BsonSerializerExtensions
{
///
/// Modifies an instance of to only use the supplied members when serializing instances.
///
/// The to modify.
/// An of that lists the members
/// required for serialization.
/// A new instance of that serializes the information in .
public static IBsonSerializer AsDenormalizingBsonClassMapSerializer(
[NotNull] this IBsonSerializer bsonSerializer,
[CanBeNull] IEnumerable denormalizedMemberNames = null)
{
TypeInfo typeInfo = Check.NotNull(bsonSerializer, nameof(bsonSerializer)).GetType().GetTypeInfo();
if (bsonSerializer is IChildSerializerConfigurable childSerializerConfigurable)
{
bsonSerializer = childSerializerConfigurable.WithChildSerializer(
childSerializerConfigurable.ChildSerializer.AsDenormalizingBsonClassMapSerializer(denormalizedMemberNames));
}
else if (typeInfo.TryGetImplementationType(typeof(ReadOnlyCollectionSerializer<>),
out Type readOnlyCollectionSerializerType)
|| typeInfo.TryGetImplementationType(typeof(ReadOnlyCollectionSubclassSerializer<,>),
out readOnlyCollectionSerializerType))
{
bsonSerializer = (IBsonSerializer) Activator.CreateInstance(readOnlyCollectionSerializerType,
((IBsonSerializer) readOnlyCollectionSerializerType
.GetProperty(nameof(EnumerableSerializerBase