public PattrInfo Save() { if (this.Id != null) { Pattr.Update(this); return(this); } return(Pattr.Insert(this)); }
public APIReturn _Add([FromForm] uint?Category_id, [FromForm] uint?Parent_id, [FromForm] bool?Is_filter, [FromForm] string Name) { PattrInfo item = new PattrInfo(); item.Category_id = Category_id; item.Parent_id = Parent_id; item.Is_filter = Is_filter; item.Name = Name; item = Pattr.Insert(item); return(APIReturn.成功.SetData("item", item.ToBson())); }
public PattrInfo AddPattr(uint?Parent_id, bool?Is_filter, string Name) => Pattr.Insert(new PattrInfo { Category_id = this.Id, Parent_id = Parent_id, Is_filter = Is_filter, Name = Name });