欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

排球计分程序(三)—— 模型类的设计与实现

发布时间:2025/3/15 编程问答 41 豆豆
生活随笔 收集整理的这篇文章主要介绍了 排球计分程序(三)—— 模型类的设计与实现 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

通过EF框架设计模型生成数据图和表: 

1)添加运动员模型类:
namespace 排球计分程序.Models
{
    public class Ball
    {
        public int ID { get; set; }
        public string XingMing { get; set; }
        public string Age { get; set; }
        public string WeiZhi { get; set; }
        public string Shenglv { get; set; }
        public string RongYu { get; set; }

    }
    public class BallDBContext : DbContext
    {
        public DbSet<Ball> Movies { get; set; }

    }
}

2)添加队伍公告模型类:

namespace 排球队伍公告信息.Models.Entities
{
    public class AnnounceInfo
    {
        public int ID { get; set; }
        public string Title { get; set; }
        public string Content { get; set; }
        public string DuiMing { get; set; }
        public string Jieshao { get; set; }
        public int Category { get; set; }
    }
}

3)添加比赛计分类:

namespace 排球计分.Models
{
    public class Team
    {
            public int ID { get; set; }//ID号
            public string Name { get; set; }//队名
            public decimal Score { get; set; }//得分
                   
            public string   Team { get; set; }
            public string  Score { get; set; }
            public string  Add { get; set; }
            public string Delete { get; set; }
            public string Faqiu { get; set; }
            public string Lanwang  { get; set; }
            public string Kouqiu { get; set; }
            public string Zhugong { get; set; }
           
    }
}

转载于:https://www.cnblogs.com/sdl1305702018/p/7063605.html

总结

以上是生活随笔为你收集整理的排球计分程序(三)—— 模型类的设计与实现的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。