private e.TournamentAssignment CreateEntityFromTournamentAssignment(TournamentAssignment ta)
        {
            if (ta == null)
            {
                return(null);
            }
            e.TournamentAssignment result = e.TournamentAssignment.CreateTournamentAssignment(ta.Id, ta.AssignmentOrder, ta.Points1, ta.Points2, ta.Points3, ta.IsActive, ta.CreateDate);

            result.AssignmentReference.Value = (from a in _m.Assignment
                                                where a.Id == ta.Assignment.Id
                                                select a).First();
            result.TournamentReference.Value = (from t in _m.Tournament
                                                where t.Id == ta.Tournament.Id
                                                select t).First();

            //e.TournamentAssignment result = new e.TournamentAssignment()
            //{
            //    Id = TA.Id,
            //    AssignmentOrder = TA.AssignmentOrder,
            //    IsActive = TA.IsActive,
            //    CreateDate = TA.CreateDate,
            //    Points1 = TA.Points1,
            //    Points2 = TA.Points2,
            //    Points3 = TA.Points3,
            //    Assignment = CreateEntityFromAssignment(TA.Assignment),
            //    Tournament = CreateEntityFromTournament(TA.Tournament)
            //};

            return(result);
        }
Exemple #2
0
        private e.TournamentAssignment CreateEntityFromTournamentAssignment(TournamentAssignment ta)
        {
            if (ta == null)
            {
                return(null);
            }

            e.TournamentAssignment result = e.TournamentAssignment.CreateTournamentAssignment(ta.Id, ta.AssignmentOrder, ta.Points1, ta.Points2, ta.Points3, ta.IsActive, ta.CreateDate);

            result.AssignmentReference.Value = (from a in _m.Assignment
                                                where a.Id == ta.Assignment.Id
                                                select a).First();
            result.TournamentReference.Value = (from t in _m.Tournament
                                                where t.Id == ta.Tournament.Id
                                                select t).First();

            return(result);
        }
        private TournamentAssignment CreateTournamentAssignmentFromEntity(e.TournamentAssignment eTournamentAssignment)
        {
            if (eTournamentAssignment == null)
            {
                return(null);
            }
            TournamentAssignment result = new TournamentAssignment()
            {
                Id = eTournamentAssignment.Id,
                AssignmentOrder = eTournamentAssignment.AssignmentOrder,
                IsActive        = eTournamentAssignment.IsActive,
                CreateDate      = eTournamentAssignment.CreateDate,
                Points1         = eTournamentAssignment.Points1,
                Points2         = eTournamentAssignment.Points2,
                Points3         = eTournamentAssignment.Points3,
                Assignment      = CreateAssignmentFromEntity(eTournamentAssignment.Assignment),
                Tournament      = CreateTournamentFromEntity(eTournamentAssignment.Tournament)
            };

            return(result);
        }