Entity and N-Tier architecture in C#
- by acadia
Hello,
I have three tables as shown below
Emp
----
empID int
empName
deptID
empDetails
-----------
empDetailsID int
empID int
empDocuments
--------------
docID
empID
docName
docType
I am creating a entity class so that I can use n-tier architecture to do database transactions etc in C#. I started creating class for the same as shown below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace employee
{
class emp
{
private int empID;
private string empName;
private int deptID;
public int EmpID { get; set; }
public string EmpName { get; set; }
public int deptID { get; set; }
}
}
My question is as empDetails and empDocuments are related to emp by empID. How do I have those in my emp class.
I would appreciate if you can direct me to an example.
Thanks