Rename solution directory to Elwig
This commit is contained in:
30
Elwig/Models/Contract.cs
Normal file
30
Elwig/Models/Contract.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
|
||||
namespace Elwig.Models {
|
||||
[Table("contract"), PrimaryKey("VNr")]
|
||||
public class Contract {
|
||||
[Column("vnr")]
|
||||
public int VNr { get; set; }
|
||||
|
||||
[Column("mgnr")]
|
||||
public int MgNr { get; set; }
|
||||
|
||||
[Column("year_from")]
|
||||
public int YearFrom { get; set; }
|
||||
|
||||
[Column("year_to")]
|
||||
public int? YearTo { get; set; }
|
||||
|
||||
[ForeignKey("MgNr")]
|
||||
public virtual Member Member { get; private set; }
|
||||
|
||||
[InverseProperty("Contract")]
|
||||
public virtual ISet<AreaCommitment> AreaCommitments { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public int Area => AreaCommitments.Select(a => a.Area).Sum();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user