public BlogListView GetBlog(int id) { Blog blog = _db.Blogs.Where(p => p.Id == id).Include(p => p.User).FirstOrDefault(); BlogListView blogView = _mapper.Map <BlogListView>(blog); return(blogView); }
public CreateBlogSteps(BlogListView blogListView, LoginView loginView, BlogCreateView blogCreateView, HomeView homeView) { _blogCreateView = blogCreateView; _blogListView = blogListView; _loginView = loginView; _homeView = homeView; }
/// <summary> /// 构造函数 /// </summary> public MarkDownCompile() { //如果不存在 则从嵌入资源内读取 model.html Assembly asm = Assembly.GetExecutingAssembly();//读取嵌入式资源 Stream sm = asm.GetManifestResourceStream("WFormMarkDown.DLL.web.model.html"); StreamReader sr = new StreamReader(sm); string configContent = sr.ReadToEnd(); sr.Close(); htmlModel = configContent; headStr = string.Join("\r\n", Program.GetConfig().Site.headref); blogListView = new BlogListView(); blogListView.bloglist = new List <BlogView>(); indexHtml = new StringBuilder(); typeList = new List <string>(); tagList = new List <string>(); }
public HomeViewSteps(HomeView homeView, BlogListView blogListView) { _homeView = homeView; _blogListView = blogListView; }