close

public partial class Worktype
{
public Worktype()
{
this.Schedule = new HashSet<Schedule>();
}
[Display(Name = "編號")]
public int Id { get; set; }  
[Display(Name = "班別名稱")]
[Required]
public string Name { get; set; }
[Display(Name = "班別狀態")]
[Required]
public string status { get; set; }
[Display(Name = "班別排序")]
[Required]
[RegularExpression(@"^[0-9]*$", ErrorMessage = "只能輸入數字")]
public short Sort { get; set; }
[Display(Name = "廠商編號")]
[Required]
public short masterid { get; set; }

public virtual ICollection<Schedule> Schedule { get; set; }
}

 

public partial class Schedule
{
public Schedule()
{
this.Worktype = new HashSet<Worktype>();
}
[Display(Name = "編號")]
public int Id { get; set; }
[Display(Name = "使用者")]
[Required]
public int UserId { get; set; }
[Display(Name = "更新日")]
[Required]
public System.DateTime Udate { get; set; }
[Display(Name = "創建日")]
[Required]
public System.DateTime Cdate { get; set; }
[Display(Name = "日期")]
[Required]
public string YMD { get; set; }
[Display(Name = "狀態")]
public string status { get; set; }

public virtual ICollection<Worktype> Worktype { get; set; }
}

未命名    

var quary = from s in db.Schedule
from wt in db.Worktype
where wt.Schedule.FirstOrDefault(x => s.Id == x.Id) != null
select s;

arrow
arrow
    全站熱搜

    小羊 發表在 痞客邦 留言(0) 人氣()