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
using MongoDB.Entities; | |
using System; | |
using System.Threading.Tasks; | |
namespace TestProg | |
{ | |
internal static class Program | |
{ | |
public class ArtGallery : Entity | |
{ |
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
using MongoDB.Driver; | |
using MongoDB.Driver.Linq; | |
using MongoDB.Entities; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace TestApplication | |
{ | |
public class User : Entity | |
{ |
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
using MongoDB.Driver; | |
using MongoDB.Driver.Linq; | |
using MongoDB.Entities; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace TestApplication | |
{ | |
public class Course : Entity |
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
using MongoDB.Bson; | |
using MongoDB.Entities; | |
using System; | |
using System.IO; | |
using System.Threading.Tasks; | |
namespace TestApplication | |
{ | |
public class Book : Entity | |
{ |
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
using MongoDB.Entities; | |
using System; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TestApplication | |
{ | |
public class UserActivity : Entity | |
{ | |
public string RawUrl { get; set; } |
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
var username = "user"; | |
var password = "password"; | |
MongoInternalIdentity internalIdentity = new("auth_db_name", username); | |
PasswordEvidence passwordEvidence = new(password); | |
MongoCredential mongoCredential = new("SCRAM-SHA-1", internalIdentity, passwordEvidence); | |
await DB.InitAsync("DatabaseName", new MongoClientSettings | |
{ | |
Server = new MongoServerAddress("localhost", 27017), |
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
using MongoDB.Entities; //https://mongodb-entities.com | |
using System; | |
using System.Threading.Tasks; | |
namespace TestApplication | |
{ | |
public class Message : Entity | |
{ | |
public string Content { get; set; } | |
public int Upvotes { get; set; } |
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
using MongoDB.Entities; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace TestApplication | |
{ | |
public static class Program | |
{ | |
public class Item : Entity | |
{ |
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
public static class Run | |
{ | |
private static bool IsDotNetFx => | |
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase); | |
private static readonly TaskFactory factory = | |
new TaskFactory( | |
CancellationToken.None, | |
TaskCreationOptions.None, | |
TaskContinuationOptions.None, |
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
using MongoDB.Bson; | |
using MongoDB.Driver; | |
using MongoDB.Entities; | |
using System.Threading.Tasks; | |
namespace ReferencedRelationshipExample | |
{ | |
public class Author : Entity | |
{ | |
public string Name { get; set; } |