コード例 #1
0
        public List <TeamDomainModel> ListTeams()
        {
            //Create a return type Object
            List <TeamDomainModel> list = new List <TeamDomainModel>();

            //Create a Context object to Connect to the database
            using (CSBAAzureEntities context = new CSBAAzureEntities())
            {
                list = (from result in context.sp_Team_Select(null)
                        select new TeamDomainModel
                {
                    TeamID = result.TeamID,
                    TeamName = result.TeamName,
                    OwnerName = result.OwnerName,
                    OwnerEmail = result.OwnerEmail,
                    OwnerUserID = result.OwnerUserID,
                    TeamImage = result.TeamImage,
                    UserName = result.UserName
                }).ToList();
            } // Guaranteed to close the Connection

            //return the list
            return(list);
        }