예제 #1
0
        public TEntity Put(TEntity item)
        {
            var dbItem = item.ToDbModel();
            var result = dbSet.Edit(dbItem);

            if (result)
            {
                if (item.TagId != null)
                {
                    BindWithTag(item.Id, (int)item.TagId);
                }
            }
            return(result ? dbItem.ToTModel() : null);
        }
예제 #2
0
 public TEntity Put(TEntity item)
 {
     try
     {
         var dbItem = item.ToDbModel();
         var result = dbSet.Edit(dbItem);
         if (result)
         {
             if (item.TagId != null)
             {
                 BindWithTag(item.Id, (int)item.TagId);
             }
         }
         return(result ? dbItem.ToTModel() : null);
     }
     catch (System.Exception ex)
     {
         Log.Error(tag, "Put", "Exception:" + ex);
         return(null);
     }
 }