Exemplo n.º 1
0
        public List <v_Team_Draft_RosterDomainModel> ListTeamRoster(int SeasonID, int TeamID)
        {
            //Create a return type Object
            List <v_Team_Draft_RosterDomainModel> list = new List <v_Team_Draft_RosterDomainModel>();

            //Create a Context object to Connect to the database
            using (CSBAAzureEntities context = new CSBAAzureEntities())
            {
                list = (from result in context.sp_Team_Roster_Select(SeasonID, TeamID)
                        select new v_Team_Draft_RosterDomainModel
                {
                    ActiveFlg = result.ActiveFlg,
                    PlayerImage = result.PlayerImage,
                    PlayerName = result.PlayerName,
                    Points = result.Points,
                    PlayerGuid = result.PlayerGUID,
                    PrimPos = result.PrimPos,
                    SeasonID = result.SeasonID,
                    SeasonName = result.SeasonName,
                    SecPos = result.SecPos,
                    TeamID = result.TeamID,
                    TeamName = result.TeamName,
                    PrimaryPositionID = result.PrimaryPositionID,
                    PositionTypeDescr = result.PositionTypeDescr,
                    PositionTypeID = result.PositionTypeID
                }).ToList();
            } // Guaranteed to close the Connection

            //return the list
            return(list);
        }