public void Add(Article article, out string contentUrl, out int id, string locationAddress) { string _contentUrl = ""; int _id = 0; Action <SqlConnection> action = (connection) => DalArticle.Add(connection, article, out _contentUrl, out _id, locationAddress); dbManager.Execute(action); contentUrl = _contentUrl; id = _id; }
public void Add(Article article) { try { Action <SqlConnection> action = (connection) => DalArticle.Add(connection, article); dbManager.Execute(action); logger.Log(Level.Info, "Add:" + JsonHelper.Serialize <Article>(article), null); } catch (Exception ex) { logger.Log(Level.Error, "Add 错误:" + ex.ToString() + "参数:" + JsonHelper.Serialize <Article>(article), null); } }