Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to sum up values of duplicate keys in a dictionary? Pin
Alex Dunlop3-Feb-21 6:50
Alex Dunlop3-Feb-21 6:50 
QuestionTrying to use and condition in Linq Query with join and on C# Pin
simpledeveloper1-Feb-21 21:04
simpledeveloper1-Feb-21 21:04 
QuestionWhat queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w29-Jan-21 22:58
arnold_w29-Jan-21 22:58 
AnswerRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Richard MacCutchan29-Jan-21 23:19
mveRichard MacCutchan29-Jan-21 23:19 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 0:31
arnold_w30-Jan-21 0:31 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Richard MacCutchan30-Jan-21 0:32
mveRichard MacCutchan30-Jan-21 0:32 
AnswerRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff29-Jan-21 23:25
mveOriginalGriff29-Jan-21 23:25 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 1:00
arnold_w30-Jan-21 1:00 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff30-Jan-21 1:17
mveOriginalGriff30-Jan-21 1:17 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 1:27
arnold_w30-Jan-21 1:27 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff30-Jan-21 1:58
mveOriginalGriff30-Jan-21 1:58 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 2:02
arnold_w30-Jan-21 2:02 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff30-Jan-21 2:39
mveOriginalGriff30-Jan-21 2:39 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 2:50
arnold_w30-Jan-21 2:50 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff30-Jan-21 5:45
mveOriginalGriff30-Jan-21 5:45 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Gerry Schmitz30-Jan-21 3:04
mveGerry Schmitz30-Jan-21 3:04 
JokeRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Peter_in_278030-Jan-21 10:39
professionalPeter_in_278030-Jan-21 10:39 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Gerry Schmitz30-Jan-21 12:29
mveGerry Schmitz30-Jan-21 12:29 
AnswerRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Ralf Meier29-Jan-21 23:25
mveRalf Meier29-Jan-21 23:25 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff29-Jan-21 23:57
mveOriginalGriff29-Jan-21 23:57 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 0:40
arnold_w30-Jan-21 0:40 
AnswerRe: multi-comport receiver Pin
Luc Pattyn31-Jan-21 4:35
sitebuilderLuc Pattyn31-Jan-21 4:35 
QuestionWrite Async Method Pin
Kevin Marois27-Jan-21 6:37
professionalKevin Marois27-Jan-21 6:37 
I want to call SaveChanges in my WPF app. SaveChanges calls AddCompany or UpdateCompany on the server, I DON'T want the UI to hang up. After the save completes, there are other things I need to do.
public override bool SaveChanges()
{
    // Validate the data entry
    bool isValid = Validate();

    if (isValid)
    {
        // Save Add or Update
        var task =  Task.Factory.StartNew(() =>
        {
            if (Company.Id == 0)
            {
                AppCore.BizObject.AddCompany(Company);
            }
            else
            {
                AppCore.BizObject.UpdateCompany(Company);
            }

        }).ContinueWith(a => 
        {
            // Do cleanup stuff

        });
    }

    return isValid;
}
This is being called from a Save button. This doesn't feel right. What's the right way to call AddCompany/UpdateCompany asynchronously and then handle the clean up stuff? I'm not sure how to structure the code.

Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.


modified 27-Jan-21 12:49pm.

AnswerRe: Write Async Method Pin
OriginalGriff27-Jan-21 8:07
mveOriginalGriff27-Jan-21 8:07 
GeneralRe: Write Async Method Pin
Kevin Marois27-Jan-21 8:37
professionalKevin Marois27-Jan-21 8:37 

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.