Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
DataMapper 3.0
-
None
Description
Add attribute sqlSource on statement tag, a type alias to a user class which implement interface ISqlSource
Sample
======
<select id="SqlSourceWithInlineParameter" parameterClass="Integer" sqlSource="SqlSourceWithInlineParameter" resultMap="account-result"/>
public class SqlSourceWithInlineParameter : ISqlSource
{
#region ISqlSource Members
/// <summary>
/// Gets the SQL text.
/// </summary>
/// <param name="mappedStatement">The mapped statement.</param>
/// <param name="parameterObject">The parameter object.</param>
/// <returns></returns>
public string GetSql(IMappedStatement mappedStatement, object parameterObject)
{
return "select * from Accounts where Account_ID = @
";
}
#endregion
}