public static void CopyFieldsTo(this DalArticle source, Article target) { if (source == null) { throw new ArgumentNullException("source"); } if (target == null) { throw new ArgumentNullException("target"); } target.Title = source.Title; target.Text = source.Text; target.BlogId = source.BlogId; }
public static Article ToModel(this DalArticleEntity item) { if (item == null) return null; Article articleEntity = new Article { Id = item.Id, Name = item.Name, BlogId = item.Blog.Id, Text = item.Text, Date = item.Date }; return articleEntity; }