/// <summary> /// 用于向 UserPoint EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddToUserPoint(UserPoint userPoint) { base.AddObject("UserPoint", userPoint); }
public void AddUserPoint(int uId, string reason, short point) { UserPoint uPoint = new UserPoint(); uPoint.UserId = uId; uPoint.Usable = true; uPoint.Reason = reason; uPoint.CreateTime = DateTime.Now; uPoint.PointCount = point; Add(uPoint); }
/// <summary> /// 创建新的 UserPoint 对象。 /// </summary> /// <param name="id">Id 属性的初始值。</param> /// <param name="userId">UserId 属性的初始值。</param> /// <param name="pointCount">PointCount 属性的初始值。</param> /// <param name="reason">Reason 属性的初始值。</param> /// <param name="usable">Usable 属性的初始值。</param> /// <param name="createTime">CreateTime 属性的初始值。</param> public static UserPoint CreateUserPoint(global::System.Int32 id, global::System.Int32 userId, global::System.Int16 pointCount, global::System.String reason, global::System.Boolean usable, global::System.DateTime createTime) { UserPoint userPoint = new UserPoint(); userPoint.Id = id; userPoint.UserId = userId; userPoint.PointCount = pointCount; userPoint.Reason = reason; userPoint.Usable = usable; userPoint.CreateTime = createTime; return userPoint; }
public void Add(UserPoint point) { db.UserPoint.AddObject(point); Save(); }