Wouldso would I design classes say in c# to signifies a database model?

Because of the following tables and fields for any database,

Table: Worker

Pk EmpID
Fk DeptID

Table: Department

Pk DeptID

So now I wish to make 2 classes in C#, one for Worker and something for Department. The part I recieve hung on may be the foreign secrets. Must I make use of the foreign secrets during my design for that objects, or must i put a reference during my Worker class from the Department,or must i put a listing of worker references during my Department class,or must i do both? I understand basically use foreign secrets, it will likely be less capable because I will need to sort through a listing of primary secrets that match the foreign key however i most likely will include them within the design anyway.

Avoid using "foreign secrets" inside your objects. Use references each Department must have a listing of Employees. Based on whether you need to backreference from Worker for their Department, result in the determination whether Worker may have a mention of the Department.

First, if at all possible I recommend utilizing a tool like NHibernate, the Entity Framework, or Linq to SQL to complete the item to relational mapping for you personally. But, if you won't want to do this, I'd most likely design my object model such as this:

public class Employee
    public int Id { get; set; }
    public string LastName { get; set; }
    public string FirstName { get; set; }
    public Address Address { get; set; } 
    public Department Department { get; set; }

public class Department
    public int Id { get; set; }
    public string Name { get; set; }
    public Address Location { get; set; }
    public ICollection<Employee> Employees { get; set; }

I'd rather not oversimplify but when you've navigation qualities from Worker => Department or Department => Worker is fairly specific to the requirements of the application.

However, usually of thumb, I am inclined to put navigation qualities from the top heirarchy lower. Which means I'd have Department.Employees although not Worker.Departments.

Again, this really is specific for you, however it appears pretty unlikely that you'd ever want to get the Department object of the many single Worker. So, research having a key within the Worker class something similar to this:

class Employee {

    public int[] DepartmentIds { get; set; }
    public List<Department> Departments {
        get {
            return YourStaticReference.DepartmentList
                .Where(x => this.DepartmentIds.Contains(x.DepartmentId));

See? All the best!