ormlite-servicestack,C#,ormlite Servicestack" /> ormlite-servicestack,C#,ormlite Servicestack" />

C# ServiceStack或MLite更新

C# ServiceStack或MLite更新,c#,ormlite-servicestack,C#,ormlite Servicestack,下面的代码工作正常 public static void UpdateCategory(Category category) { var dbFactory = new OrmLiteConnectionFactory(connString, SqlServerDialect.Provider); using (IDbConnection db = dbFactory.OpenDbConnection()) { try{ db.Update<Category&g

下面的代码工作正常

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));
    }
  }
}
谢谢