private WebAPI.Models.RSS DataRowToWebApiModel(DataRow dr) { WebAPI.Models.RSS rss = new WebAPI.Models.RSS(); try { if (dr["RSSID"] != System.DBNull.Value) { rss.RSSID = (String)dr["RSSID"].ToString(); } if (dr["RSSName"] != System.DBNull.Value) { rss.Name = (String)dr["RSSName"]; } if (dr["RSSIcon"] != System.DBNull.Value) { rss.Icon = (String)dr["RSSIcon"]; } if (dr["RSSDescription"] != System.DBNull.Value) { rss.Description = (String)dr["RSSDescription"]; } return rss; } catch (Exception ex) { return null; } }
private WebAPI.Models.RSS DALObjectToWebApiModel(RSS.RSS data) { WebAPI.Models.RSS rss = new WebAPI.Models.RSS(); try { rss.RSSID = data.RSSID.ToString(); rss.Name = data.Name; rss.Icon = data.Icon; rss.Description = data.Description; return rss; } catch (Exception ex) { return null; } }