In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "how to understand the framework of ASP.NET MVC5 website development and consulting management". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
I. General explanation
1. Realize the function
2. Class diagram
Since most of the classes are implemented in the article section, there is only one more Consultation class.
Second, create a consulting model class
Add the class Consultation (consultation model) to the Ninesky.Models project, which, like Article, is an extension of CommonModel.
1. Add Consultation class.
Using System;using System.ComponentModel.DataAnnotations;namespace Ninesky.Models {/ Consulting Model / create: 2014.02.06 / / public class Consultation {[Key] public int ConsultationID {get; set;} / name / [Display (Name = "name")] [Required (ErrorMessage= "required")] public string Name {get; set } / QQ number / [Display (Name = "QQ number")] [StringLength (16 minimum numbers 6, ErrorMessage = "{1}-{0} digits")] public string QQ {get; set } / Email address / [Display (Name = "Email address")] [DataType (DataType.EmailAddress,ErrorMessage= "must enter the correct Email address")] public string Email {get; set } / content / [Display (Name = "content")] [Required (ErrorMessage = "required")] [StringLength (1000, ErrorMessage = "must be less than {0} characters")] public string Content {get; set;} / whether it is public / [Display (Name = "public")] public bool IsPublic {get; set } / reply content / [Display (Name = "reply content")] public string ReplyContent {get; set;} / reply time / [Display (Name = "reply time")] public Nullable ReplyTime {get; set;}
2. Add foreign keys to CommonModel
Add a controller
Open the Ninesky.Web project to add a Consultation controller in the Member area
Using Ninesky.BLL;using Ninesky.IBLL;using Ninesky.Models;using System.Linq;using System.Web.Mvc;namespace Ninesky.Web.Areas.Member.Controllers {/ consult the controller / [Authorize] public class ConsultationController: Controller {private InterfaceCommonModelService commonModelService; public ConsultationController () {commonModelService = new CommonModelService ();}
The model is the foreign key of CommonModel, so you just need to operate on CommonModel directly. There is no need to add DAL,BLL, so the content is relatively simple.
This is the end of the content of "how to understand the architecture of ASP.NET MVC5 website development and consulting management". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.