Implementation of alumni three-entity model based on. NET MVC

Source: Internet
Author: User

Due to the actual development, but also the time is relatively tight, so, in the development of the implementation process, there are always some changes to the original plan:

Alumnibookmodel Database Entity Model

This is the primary data entity class, the EF generates a database based on this entity, each member of which is a dbset type, a dataset type, an in-memory table, with nine tables in the database Alumnibookmodel the name of the member, but, if you open the database, It will be found that their table names are the plural of these member names, and this mechanism, which has already been said at the beginning, is no longer spoken here. Let's take a look at its constructor:

public class Alumnibookmodel:dbcontext
    
    {public
    
        Alumnibookmodel ()
    
            : Base ("Abconnection")
    
        {
    
        } Public
    
        dbset<admin> Admin {get; set;}
    
        Public dbset<user> User {get; set;}
    
        Public dbset<userinfo> UserInfo {get; set;}
    
        Public dbset<class> Class {get; set;}
    
     
    
     Public dbset<school> School {get; set;}
    
Alumnibookmodel inherits DbContext, which is the database context class, which wants to be a database type, encapsulates different data, and constructs a parameter abconnection in Web.config
    
  < connectionstrings>
    
    <add name= "abconnection" connectionstring= "Data source=| datadirectory| Alumnibook.sdf "providername=" system.data.sqlserverce.4.0 "/>
    
  </connectionStrings>

ConnectionString database connection string, the database will be based on it at the appropriate time to create a database, details, I introduced the EF when I have said, here is not in detail.

A common data Entity Model Class (table) is described below--userinfo

Username Entity Model Diagram

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.