public static BllCommentEntity ToBal(this DalCommentEntity itemCommentEntity) { if (itemCommentEntity == null) { return(null); } return(new BllCommentEntity { Id = itemCommentEntity.Id, Text = itemCommentEntity.Text, Article = itemCommentEntity.Article.ToBal(), Date = itemCommentEntity.Date, User = itemCommentEntity.User.ToBal() }); }
public static Comment ToModel(this DalCommentEntity item) { if (item == null) { return(null); } Comment comment = new Comment { Id = item.Id, Text = item.Text, ArticleId = item.Article.Id, Date = item.Date, UserId = item.User.Id }; return(comment); }
public static DalCommentEntity ToDal(this Comment item) { if (item == null) { return(null); } DalCommentEntity tagDalEntity = new DalCommentEntity { Id = item.Id, Text = item.Text, Article = item.Article.ToDal(), User = item.User.ToDal(), Date = item.Date }; return(tagDalEntity); }