generated from SwissLife-OSS/template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added sample launch settings. * Sample application with rest and squadron.
- Loading branch information
Showing
33 changed files
with
486 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
samples/Context/DataAccess/Configuration/BlogCollectionConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Models; | ||
|
||
namespace SimpleBlog.DataAccess | ||
{ | ||
public interface IBlogRepository | ||
{ | ||
Task AddBlogAsync(Blog blog, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Models; | ||
|
||
namespace SimpleBlog.DataAccess | ||
{ | ||
public interface ITagRepository | ||
{ | ||
Task TryAddTagsAsync(IEnumerable<Tag> newTags, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Models; | ||
|
||
namespace SimpleBlog.DataAccess | ||
{ | ||
public interface IUserRepository | ||
{ | ||
Task AddUserAsync(User user, CancellationToken cancellationToken = default); | ||
Task AttachBlogToUserAsync(string userId, Guid blogId, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using MongoDB.Driver; | ||
using Tag = Models.Tag; | ||
|
||
namespace DataAccess | ||
namespace SimpleBlog.DataAccess | ||
{ | ||
public class TagRepository | ||
public class TagRepository : ITagRepository | ||
{ | ||
private InsertOneOptions _insertOneOptions; | ||
private InsertManyOptions _insertManyOptions; | ||
private IMongoCollection<Tag> _mongoCollection; | ||
public TagRepository(SimpleBlogDbContext simpleBlogDbContext) | ||
|
||
public TagRepository(ISimpleBlogDbContext simpleBlogDbContext) | ||
{ | ||
if (simpleBlogDbContext == null) | ||
throw new ArgumentNullException(nameof(simpleBlogDbContext)); | ||
|
||
_mongoCollection = simpleBlogDbContext.CreateCollection<Tag>(); | ||
|
||
_insertOneOptions = new InsertOneOptions() | ||
_insertManyOptions = new InsertManyOptions() | ||
{ | ||
BypassDocumentValidation = false | ||
BypassDocumentValidation = false, | ||
IsOrdered = false | ||
}; | ||
} | ||
public async Task AddTagAsync( | ||
Tag tag, CancellationToken cancellationToken) | ||
|
||
public async Task TryAddTagsAsync( | ||
IEnumerable<Tag> tags, CancellationToken cancellationToken) | ||
{ | ||
await _mongoCollection | ||
.InsertOneAsync(tag, _insertOneOptions, cancellationToken); | ||
//FilterDefinition<Tag> filter = Builders<Tag>.Filter | ||
// .Eq(t => t.Name, tenantName); | ||
|
||
//Builders<Tag>.Update.SetOnInsert() | ||
|
||
//await _mongoCollection | ||
// .UpdateManyAsync(tags, _insertManyOptions, cancellationToken); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace SimpleBlog.DataAccess | ||
{ | ||
public static class WellKnown | ||
{ | ||
public static class Path | ||
{ | ||
public const string SimpleBlogDB = "SimpleBlog:Database"; | ||
} | ||
} | ||
} |
Oops, something went wrong.