コード例 #1
0
 public PattrInfo Save()
 {
     if (this.Id != null)
     {
         Pattr.Update(this);
         return(this);
     }
     return(Pattr.Insert(this));
 }
コード例 #2
0
        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()));
        }
コード例 #3
0
 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
 });