public PickAPlayerDomainModel PickAPLayer(int SeasonID) { PickAPlayerDomainModel PickPlayer = new PickAPlayerDomainModel(); using (CSBAAzureEntities context = new CSBAAzureEntities()) { PickPlayer = (from result in context.PickAPlayer(SeasonID) select new PickAPlayerDomainModel { PlayerGUID = result.PlayerGUID, PlayerImage = result.PlayerImage, PlayerName = result.PlayerName, PrimPositionTypeID = result.PrimPositionTypeID, PrimPositionName = result.PrimPositionName, PrimPositionTypeDescr = result.PrimPositionTypeDescr, SecPositionName = result.SecPositionName, SecPositionTypeDescr = result.SecPositionTypeDescr }).FirstOrDefault(); } // Guaranteed to close the Connection return(PickPlayer); }