Click here to Skip to main content
15,888,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using Clang in c# project Pin
OriginalGriff2-Feb-19 19:32
mveOriginalGriff2-Feb-19 19:32 
GeneralRe: Using Clang in c# project Pin
jschell17-Feb-19 5:33
jschell17-Feb-19 5:33 
GeneralRe: Using Clang in c# project Pin
OriginalGriff17-Feb-19 6:02
mveOriginalGriff17-Feb-19 6:02 
QuestionPassing Json from Winforms to console app for writing to file Pin
jkirkerx31-Jan-19 9:58
professionaljkirkerx31-Jan-19 9:58 
AnswerRe: Passing Json from Winforms to console app for writing to file Pin
jkirkerx31-Jan-19 10:18
professionaljkirkerx31-Jan-19 10:18 
AnswerRe: Passing Json from Winforms to console app for writing to file Pin
Dave Kreskowiak31-Jan-19 13:52
mveDave Kreskowiak31-Jan-19 13:52 
GeneralRe: Passing Json from Winforms to console app for writing to file Pin
jkirkerx1-Feb-19 7:50
professionaljkirkerx1-Feb-19 7:50 
QuestionC# MongoDB Guid Problem Pin
Kevin Marois31-Jan-19 7:49
professionalKevin Marois31-Jan-19 7:49 
I'm learning MongoDB. I'm working on a Repository<t> implementation for both MongoDB and LinqToSQL.

My MongoRepository Add method is
//T is a StudentEntity

public override void Add(T entity)
{
    var collection = GetCollection(CollectionName);
    collection.InsertOne(entity);
}
This works fine. This writes out
_id:Binary('aE/9nTBrM0mkDMf6/GpSCg==')
FirstName:"John"
LastName:"Smith"
Class:"English 101"
Age:32
to the Students collection.

Then, my Get method has:
public override T Get(Guid id)
{
    var collection = GetCollection(CollectionName);
    var result = collection.Find(r => r.Id == id).FirstOrDefault();
    return result;
}
and I call it like this
private static void GetStudent()
{
    var student = _repository.Get(new Guid("aE/9nTBrM0mkDMf6/GpSCg=="));  //<=== THROWS
    Console.WriteLine(student);
}
The exception is "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'"

It seems that Mongo stores the Guid differently than in .Net. What's the right way to fix this? Not sure how to handle this.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: C# MongoDB Guid Problem Pin
BillWoodruff31-Jan-19 12:26
professionalBillWoodruff31-Jan-19 12:26 
AnswerRe: C# MongoDB Guid Problem Pin
Richard Deeming1-Feb-19 1:12
mveRichard Deeming1-Feb-19 1:12 
QuestionExtracting string between quotes Pin
Priya Karthish31-Jan-19 0:08
Priya Karthish31-Jan-19 0:08 
AnswerRe: Extracting string between quotes Pin
lmoelleb31-Jan-19 0:23
lmoelleb31-Jan-19 0:23 
AnswerRe: Extracting string between quotes Pin
OriginalGriff31-Jan-19 0:53
mveOriginalGriff31-Jan-19 0:53 
JokeRe: Extracting string between quotes Pin
Richard Deeming1-Feb-19 1:08
mveRichard Deeming1-Feb-19 1:08 
AnswerRe: Extracting string between quotes Pin
AFell231-Jan-19 5:35
AFell231-Jan-19 5:35 
QuestionC# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
jkirkerx30-Jan-19 9:54
professionaljkirkerx30-Jan-19 9:54 
AnswerMy Bad! Pin
jkirkerx30-Jan-19 11:32
professionaljkirkerx30-Jan-19 11:32 
GeneralRe: My Bad! Pin
OriginalGriff30-Jan-19 21:20
mveOriginalGriff30-Jan-19 21:20 
GeneralRe: My Bad! Pin
jkirkerx1-Feb-19 7:45
professionaljkirkerx1-Feb-19 7:45 
AnswerRe: C# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
Eddy Vluggen1-Feb-19 2:12
professionalEddy Vluggen1-Feb-19 2:12 
GeneralRe: C# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
jkirkerx1-Feb-19 7:48
professionaljkirkerx1-Feb-19 7:48 
GeneralRe: C# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
Eddy Vluggen1-Feb-19 8:39
professionalEddy Vluggen1-Feb-19 8:39 
GeneralRe: C# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
jkirkerx1-Feb-19 8:44
professionaljkirkerx1-Feb-19 8:44 
GeneralRe: C# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
Eddy Vluggen1-Feb-19 9:29
professionalEddy Vluggen1-Feb-19 9:29 
GeneralRe: C# Winforms, Installation Folder Permission, parameter settings file is always admin read/write, user read only Pin
jkirkerx1-Feb-19 9:39
professionaljkirkerx1-Feb-19 9:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.