/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSasapirecord(ref DataRow row, Sasapirecord entity) { row.SetField("applicationid", entity.applicationid); row.SetField("applicationname", entity.applicationname); row.SetField("applogicalid", entity.applogicalid); row.SetField("baseurl", entity.baseurl); row.SetField("consumerkey", entity.consumerkey); row.SetField("secretkey", entity.secretkey); row.SetField("securitytype", entity.securitytype); row.SetField("sasapirowid", entity.sasapirowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Sasapirecord BuildSasapirecordFromRow(DataRow row) { Sasapirecord entity = new Sasapirecord(); entity.applicationid = row.IsNull("applicationid") ? string.Empty : row.Field <string>("applicationid"); entity.applicationname = row.IsNull("applicationname") ? string.Empty : row.Field <string>("applicationname"); entity.applogicalid = row.IsNull("applogicalid") ? string.Empty : row.Field <string>("applogicalid"); entity.baseurl = row.IsNull("baseurl") ? string.Empty : row.Field <string>("baseurl"); entity.consumerkey = row.IsNull("consumerkey") ? string.Empty : row.Field <string>("consumerkey"); entity.secretkey = row.IsNull("secretkey") ? string.Empty : row.Field <string>("secretkey"); entity.securitytype = row.IsNull("securitytype") ? string.Empty : row.Field <string>("securitytype"); entity.sasapirowid = row.Field <byte[]>("sasapirowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }