asp.net mvc entity framework 資料庫 練習(一)

來源:互聯網
上載者:User

標籤:官方   asp   work   tin   eating   cti   creating   with   設計   

本文啟發的思路來源於asp.net mvc 6 的entity framework,微軟MSDN中的官方項目contoso university 虛構的資料庫

原文連結如下;

https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

針對項目中的實際需求,考慮使用的資料結構包括:生產線員工,生產線裝置,產品型號,工藝資料等資訊。

    public class UserInfo    {        public string UserID { get; set; }        public string UserName { get; set; }        public int UserAge { get; set; }        public string UserSkill { get; set; }        public string UserJob { get; set; }        public string UserRole { get; set; }        public string UserStatus { get; set; }        public string UserFingerPrint { get; set; }        public string UserTeamNum { get; set; }        public DateTime UserTime { get; set; }        public string UserPassword { get; set; }        public virtual ICollection<DeviceInfo> DeviceInfoes { get; set; }        public virtual ICollection<ProductInfo> ProductInfoes { get; set; }    }
    //Device     public class DeviceInfo    {        public int DeviceID { get; set; }        public string DeviceName { get; set; }        public DateTime? DeviceTimeBought { get; set; }        public DateTime? DeviceTimeUseAll { get; set; }        public DateTime? DeviceTimeUserAfterMaintain { get; set; }        public DateTime? DeviceTimeUseThisTime { get; set; }        public DateTime? DeviceMaintainTime { get; set; }        public string DevieceUser { get; set; }        public string DeviceBelonging { get; set; }        public string DeviceRunCycyle { get; set; }        public string DevicepartNum { get; set; }        public int? ProductID { get; set; }        public string UserID { get; set; }        public virtual UserInfo UserInfo { get; set; }        public virtual ProductInfo ProductInfo { get; set; }    }
    public class ProductInfo    {        public int ProductID { get; set; }        public string DeviceID { get; set; }        public string UserID { get; set; }        public int ProductpipeLineNum { get; set; }        public int ProductOrderNum { get; set; }        public string ProductMark { get; set; }        public float? ProductParameter { get; set; }        public float? ProductDifference { get; set; }        public float? ProductRunOut { get; set; }        public string ProductRivetPart { get; set; }        public string ProductRivet2Part { get; set; }        public string ProductRubPart { get; set; }        public string ProductHubPart { get; set; }        public string ProductSuckPart { get; set; }        public string ProductPadPart { get; set; }        public string ProductTeamNum { get; set; }        public string ProductStatus { get; set; }        public DateTime? ProductStartTime { get; set; }        public DateTime? ProductFinishedTime { get; set; }        public bool ProductResult { get; set; }        public virtual UserInfo UserInfo { get; set; }        public virtual DeviceInfo DeviceInfo { get; set; }    }
    //ParameterData    public class ParameterDate    {        public DateTime? PDPickTime { get; set; }        public string PDRunout { get; set; }        public string PDDifference { get; set; }        public string PDPressure { get; set; }        public string PDStatus { get; set; }        public string PDCountID { get; set; }        public string ProductID { get; set; }        public string DeviceID { get; set; }        public string UserID { get; set; }        public virtual UserInfo UserInfo { get; set; }        public virtual ProductInfo ProductInfo { get; set; }        public virtual DeviceInfo DeviceInfo { get; set; }    }

通過設計資料庫將資料關聯起來,實現crud操作,下一節內容繼續按照文章的思路繼續。

asp.net mvc entity framework 資料庫 練習(一)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.