public ChallengeFileComponent() { mifnexsoEntities = new MIFNEXSOEntities(); challengeFile = new ChallengeFile(); challengeFile.ChallengeObjectId = Guid.Empty; challengeFile.ChallengeReferenceId = string.Empty; mifnexsoEntities.ChallengeFiles.AddObject(challengeFile); }
public ChallengeFileComponent(Guid challengeObjectId) { if (challengeObjectId != Guid.Empty) { mifnexsoEntities = new MIFNEXSOEntities(); try { challengeFile = mifnexsoEntities.ChallengeFiles.FirstOrDefault(a => a.ChallengeObjectId == challengeObjectId); if (challengeFile == null) { challengeFile = new ChallengeFile(); challengeFile.ChallengeObjectId = Guid.Empty; challengeFile.ChallengeReferenceId = string.Empty; mifnexsoEntities.ChallengeFiles.AddObject(challengeFile); } } catch (Exception) { throw; } } }