Asp mvc 5实体框架6

时间:2016-05-16 07:14:16

标签: asp.net-mvc entity-framework-6

如何总结行中单独列中字段的值?

public class Ball    
{    
    public int BallId { get; set; }
    public int Ball1 { get; set; }
    public int Ball2 { get; set; }
    public int Ball3 { get; set; }

    public int Summa {
        get {return Ball1 + Ball2;}
        private set { }
    }

enter image description here

1 个答案:

答案 0 :(得分:0)

创建单独的部分调用并定义您的属性。

public partial class Ball    
{        

    public int Summa {
        get {return Ball1 + Ball2;}
        private set { }
    }