62,244
社区成员




namespace XYZHSystem.Models
{
using System;
using System.Collections.Generic;
public partial class XYUser
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public XYUser()
{
this.Cart = new HashSet<Cart>();
}
public int UserId { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Cart> Cart { get; set; }
}
}
(from u in dbContext.XYUser
where u.UserName==name && u.Password==password
select u).FirstOrDefault();
另外 你应该建立一个实体类 post类