{"comment":{"url":"https://api.github.com/repos/rjbez17/loopback-connector-mssql/comments/9685102","html_url":"https://github.com/rjbez17/loopback-connector-mssql/commit/03eb1648af5981e76bd31b0b96e6486740506f5e#commitcomment-9685102","id":9685102,"user":{"login":"raymondfeng","id":540892,"avatar_url":"https://avatars.githubusercontent.com/u/540892?v=3","gravatar_id":"","url":"https://api.github.com/users/raymondfeng","html_url":"https://github.com/raymondfeng","followers_url":"https://api.github.com/users/raymondfeng/followers","following_url":"https://api.github.com/users/raymondfeng/following{/other_user}","gists_url":"https://api.github.com/users/raymondfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondfeng/subscriptions","organizations_url":"https://api.github.com/users/raymondfeng/orgs","repos_url":"https://api.github.com/users/raymondfeng/repos","events_url":"https://api.github.com/users/raymondfeng/events{/privacy}","received_events_url":"https://api.github.com/users/raymondfeng/received_events","type":"User","site_admin":false},"position":7,"line":160,"path":"lib/mssql.js","commit_id":"03eb1648af5981e76bd31b0b96e6486740506f5e","created_at":"2015-02-10T22:15:14Z","updated_at":"2015-02-10T22:15:14Z","body":"Can you refactor the repeating code into a function? For example,\r\n```js\r\nMsSQL.prototype._getPK = function (model) {\r\n  var modelPKID = this.idName(model);\r\n  if (modelPKID === undefined) {\r\n    throw new Error('Id property is required for model ' + model);\r\n  } \r\n  return modelPKID;\r\n}\r\n```"}}