In the previous article, we analyzed the base class entity of the entity class, and in this article we analyzed the entity classes based on the class.
Each entity class will have two files, we take blogclass as an example, the class contains two files: BlogClass.cs and BlogClass.designer.cs, this is very similar to the code generated by yourself, and, more conveniently, VS will automatically fold the two files, as shown.
In these two files, BlogClass.designer.cs contains all the generated code: Members, attributes, and so on, while BlogClass.cs contains only the definition of a class that we can use to fill in the code.
BlogClass.designer.cs's code is as follows.
1:using System;
2:using System.Collections.Generic;
3:using System.Data.Linq;
4:using System.Linq;
5:using System.Text;
6:7: Using Dongblog.common;
8:9: namespace DongBlog.Business.Blogs: {one:///<summary> 12:///log Category:///</summary>
14:public Partial class Blogclass: {#region ID and timestamp 17:18:private int _id = new_entity_id;
19:private byte[] _timestamp = new byte[] {}; 20:21:///<summary> 22:///obtained ID:///</summary> 24:public override int ID 25:
{26:get {return _id;} :///<summary> 29:///time stamp:///</summary> 31:public override byte[] Ti
Mestamp: {33:get {return _timestamp;}
35:36: #endregion 37:38: #region member 39:40:private string _name;
41:private string _description; 42:43: #endregion 44:45: #region Property 46:47:///<summary> 48:///Get or set name:///</summary> 50:public String name 51: {52:
get {return _name;}
53:set {_name = value;} ///<summary> 56:///Get or set description:///</summary> 58:public string Descripti
On: {60:get {return _description}
61:set {_description = value;} 63:64: #endregion 65:} 66:}