Here are a couple of cut down examples of classes I have seen labelled
as 'provider' classes :
1)
public class SqlArticlesProv ider : ArticlesProvide r
{
/// <summary>
/// Returns a collection with all the categories
/// </summary>
public override List<CategoryDe tailsGetCategor ies()
{
using (SqlConnection cn = new
SqlConnection(t his.ConnectionS tring))
{
SqlCommand cmd = new
SqlCommand("tbh _Articles_GetCa tegories", cn);
cmd.CommandType = CommandType.Sto redProcedure;
cn.Open();
return GetCategoryColl ectionFromReade r(ExecuteReader (cmd));
}
}
....
}
2)
public static class CleanseJobProvi der
{
/// <summary>
/// Returns an XmlDocument
/// </summary>
/// <param name="userName" ></param>
/// <param name="password" ></param>
/// <param name="jobID"></param>
/// <param name="userID"></param>
/// <returns></returns>
public static XmlDocument GetDefaultExtra ction(string userName,
string password, int jobID, int userID)
{
slndat13.Integr ator intergratorProx y = GetProxy(userNa me,
password);
object[] iresult =
intergratorProx y.DefaultEmptyE xtraction(jobID , userID);
XmlDocument doc = new XmlDocument();
if (iresult[0] is DataSet)
{
if (((DataSet)ires ult[0]).Tables.Count 0)
{
DataRow dr =
((DataSet)iresu lt[0]).Tables[0].Rows[0];
SqlXml sqlx = (SqlXml)dr[0];
if (!sqlx.IsNull)
{
//System.Diagnost ics.Debug.Write Line(sqlx.Value );
doc.LoadXml("<j ob>" + sqlx.Value + "</job>");
}
}
}
return doc;
}
...
}
*** Sent via Developersdex
http://www.developersdex.com ***