public TEntity Post(TEntity item) { var dbItem = item.ToDbModel(); var result = dbSet.Add(dbItem); return(result ? dbItem.ToTModel() : null); }
public TEntity Post(string pid, TEntity item) { item.ParentId = pid.ToInt(); var dbItem = item.ToDbModel(); var result = dbSet.Add(dbItem); return(result ? dbItem.ToTModel() : null); }
public TEntity Put(TEntity item) { var dbItem = item.ToDbModel(); dbItem.ModifyTime = DateTime.Now; dbItem.ModifyTimeStamp = TimeConvert.DateTimeToTimeStamp(dbItem.ModifyTime); var result = dbSet.Edit(dbItem); return(result ? dbItem.ToTModel() : null); }