Ejemplo n.º 1
0
        public async Task <Division> GetDivisionAsync(int divisionId)
        {
            Division newDivision = null;

            using (var context = new DatabaseContext())
            {
                InternalModel.Division division =
                    await context.Divisions.FirstOrDefaultAsync(d => d.DivisionId == divisionId);

                if (division != null)
                {
                    newDivision = Division.Convert(division);
                }
            }

            return(newDivision);
        }
Ejemplo n.º 2
0
 internal static Division Convert(InternalModel.Division division)
 {
     return(new Division(
                division.DivisionId,
                division.MiniName,
                division.ShortName,
                division.LongName,
                division.CompId,
                division.SeqNo,
                division.Promotions,
                division.Demotions,
                division.PlayOffs,
                division.PlayOffTypeId,
                division.PointsWin,
                division.PointsDraw,
                division.CustomerId,
                division.IsGroup,
                division.DivisionMemo,
                division.UseBonusPoints));
 }