public T FirstOrDefault(int id) { DataRow row = MyDbConnection.SelectById(TableName, id); if (row == null) { return(EmptyModel()); } return(CreateModel(row)); }
public T FirstOrFail(int id) { DataRow row = MyDbConnection.SelectById(TableName, id); if (row == null) { throw new Exception("Not found"); } return(CreateModel(row)); }