Browse Source

[WebApiUtils] Fixed AddDbo

feature/authentication-tests
Robin Thoni 9 years ago
parent
commit
4dd5c09a84
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      WebApiUtils/BusinessManager/SqlServerManager.cs

+ 2
- 2
WebApiUtils/BusinessManager/SqlServerManager.cs View File

199
                 var item = DboAddToDbStatic(obj);
199
                 var item = DboAddToDbStatic(obj);
200
                 if (!item)
200
                 if (!item)
201
                     return item.To<T>();
201
                     return item.To<T>();
202
-                table.Add(item.Data);
202
+                var insertedObj = table.Add(item.Data);
203
                 db.SaveChanges();
203
                 db.SaveChanges();
204
-                var res = returnFunc.Compile().DynamicInvoke(item.Data);
204
+                var res = returnFunc.Compile().DynamicInvoke(insertedObj);
205
                 return OpResult<T>.Ok((T)res);
205
                 return OpResult<T>.Ok((T)res);
206
             });
206
             });
207
         }
207
         }

Loading…
Cancel
Save