Fizzi.Applications.ChallongeVisualization.Model.TournamentContext.CommitChanges C# (CSharp) Method

CommitChanges() public method

public CommitChanges ( ) : void
return void
        public void CommitChanges()
        {
            if (Tournament != null && Tournament.Participants != null)
            {
                foreach (var p in Tournament.Participants)
                {
                    var miscDirtyable = p.Value.MiscProperties;

                    try
                    {
                        miscDirtyable.CommitIfDirty(() => Portal.SetParticipantMisc(Tournament.Id, p.Value.Id, miscDirtyable.Value.ToString()));
                    }
                    catch (Exception)
                    {
                        //If an exception is thrown trying to commit dirty data the object will stay marked as dirty and a commit will be attempted
                        //next time a scan occurs. The error itself is ignored
                    }
                }
            }
        }