以下代码运行正常。
public static void UpdateCategory(Category category) {
var dbFactory = new OrmLiteConnectionFactory(connString, SqlServerDialect.Provider);
using (IDbConnection db = dbFactory.OpenDbConnection()) {
try{
db.Update<Category>(category);
}
catch (Exception e) {
throw new Exception(string.Format("Error within {0}", e.Message));
}
}
}
下面的代码没有?
public static int UpdateRowInTable<T>(object value) {
var dbFactory = new OrmLiteConnectionFactory(connString, SqlServerDialect.Provider);
using (IDbConnection db = dbFactory.OpenDbConnection()) {
try {
result = db.Update<T>(value);
}
catch (Exception e) {
throw new Exception(string.Format("Error within {0}", e.Message));
}
}
}
感谢