Department Model - Complete Field Reference
This page provides complete documentation of all Department model properties.
Note: The
Departmentis a master entity representing a real estate department/office and is stored in its own collection.
Department Class
The main class representing a real estate office or department.
Core Identification
| Property | Type | Description | Example |
|---|---|---|---|
Id |
string |
Unique identifier for this department. | "3005093" |
DepartmentNumber |
int? |
Department number (Vitec: avdeling) | 3005093 |
Origin |
string? |
The source system the data originated from. | "Vitec" |
LastModifiedOrigin |
DateTime? |
When this department record was last updated in the origin system. | 2025-10-28T14:39:00Z |
LastModifiedLocal |
DateTime? |
When this department record was last updated locally in Destinet. | 2025-10-28T15:30:00Z |
Name and Corporate Information
| Property | Type | Description | Example |
|---|---|---|---|
Name |
string |
Department display name (Primary Name). | "Proaktiv - Meglerhuset Borg Næring" |
MarketingName |
string? |
Marketing name (Norwegian: Markedsføringsnavn). | "Proaktiv Trondheim Sentrum" |
LegalName |
string? |
Legal/registered company name. | "Meglerhuset Borg AS" |
RegistrationNumber |
string? |
Organization/company registration number. | "994976192" |
IsRegion |
bool? |
Whether this is a region (Vitec: region). | true / false |
IsPartOfFranchise |
bool? |
Whether part of a franchise (Vitec: franchise). | true / false |
SubDepartments |
List<int>? |
List of sub-department IDs (Vitec: subOffices). | [3005094, 3005095] |
Contact and Location
| Property | Type | Description | Example |
|---|---|---|---|
Phone |
string? |
Primary phone number. | "69 12 60 60" |
Email |
string? |
Primary email address. | "borg@proaktiv.no" |
LeadsEmail |
string? |
Email address for leads and inquiries. | "leads.trondheim@proaktiv.no" |
Website |
string? |
Department website URL. | "www.proaktiv.no" |
Address |
Address? |
Office/visiting address. | Full Address object |
Content and Marketing
| Property | Type | Description | Example |
|---|---|---|---|
Description |
string? |
Detailed description/biography of the department. | Full text description |
ShortDescription |
string? |
Short summary for listing overviews. | "Experts in commercial real estate in Østfold." |
LogoUrl |
string? |
Department logo URL. | https://cdn.department.com/logo.png |
VideoUrl |
string? |
URL to department video presentation. | https://player.vimeo.com/video/12345 |
HeaderImageUrl |
string? |
URL to header/banner image. | https://cdn.department.com/header.jpg |
PriceListUrl |
string? |
URL to price list document/terms. | /PriceList Pacta Proaktiv.pdf |
Images |
ImageCollection? |
Images of the department/office (facade, interior). | Collection of Image objects |
ImageTimestamp |
DateTime? |
Timestamp for when images were last updated. | 2025-10-25T10:30:00Z |
Responsible Personnel (Employee ID References)
These properties store IDs that reference a separate Employees collection.
| Property | Type | Description (Norwegian) | Example |
|---|---|---|---|
ManagingDirectorIds |
List<string>? |
References to managing director(s) (Daglig leder). | ["3006722"] |
DepartmentManagerIds |
List<string>? |
References to department manager(s) (Avdelingsleder). | ["3006723"] |
ResponsibleBrokerIds |
List<string>? |
References to responsible broker(s) (Fagansvarlig). | ["3006708"] |
Usage:
// Store only IDs in Department
department.ManagingDirectorIds.Add("3006722");
// Look up full details from separate collections when needed
var employee = GetEmployeeById(department.ManagingDirectorIds.First());
Publishing, Status and Service Area
| Property | Type | Description | Example |
|---|---|---|---|
WebPublish |
bool? |
Whether this department should be published on the web. | true / false |
IsActive |
bool? |
Whether the department is currently active. | true / false |
IsRentalSpecialist |
bool? |
Whether the department specializes in rental properties (Utleiemegler). | true / false |
Order |
int? |
Display order/sequence number for this department. | 1 |
ServiceAreaPostalCodes |
List<string>? |
Postal codes for the service area this office covers (Postnummer overstyring). | ["7042", "7043", "7044"] |
Origin Data
| Property | Type | Description | Example |
|---|---|---|---|
CustomData |
Dictionary<string, object>? |
System-specific metadata that doesn't fit the standard model. | { "VitecAgreementNo": "1001", "LastSyncTime": "..." } |
Supporting Classes (Shared)
For complete documentation of shared classes, see the Shared Classes section.
These classes are reusable across multiple model types (Estate, Department, Employee, Project, etc.). They are documented in detail in their own pages.
- Address - Location information (Street, City, PostalCode, etc.)
- Image - Generic image class for all entities
Complete Usage Example
var department = new Department
{
// Core Identification
Id = "3005093",
DepartmentNumber = 3005093,
Origin = "Vitec",
LastModifiedOrigin = DateTime.Parse("2025-10-28T14:39:00Z"),
LastModifiedLocal = DateTime.Parse("2025-10-28T15:30:00Z"),
// Name and Corporate Information
Name = "Proaktiv Eiendomsmegling - Trondheim",
MarketingName = "Proaktiv Trondheim Sentrum",
LegalName = "Meglerhuset Borg AS",
RegistrationNumber = "994976192",
IsRegion = false,
IsPartOfFranchise = true,
SubDepartments = new List<int> { 3005094, 3005095 },
// Contact and Location
Phone = "73 10 10 10",
Email = "trondheim@proaktiv.no",
LeadsEmail = "leads.trondheim@proaktiv.no",
Website = "https://www.proaktiv.no/trondheim",
Address = new Address
{
Street = "Dronningens gate 10",
LocalAreaName = "Midtbyen",
ZipCode = "7011",
City = "Trondheim",
Municipality = "Trondheim",
County = "Trøndelag",
Country = "Norway",
CountryCode = "NO"
},
// Content and Marketing
Description = "Proaktiv Trondheim Sentrum is your local expert in residential and commercial real estate, offering personalized service and deep market insight.",
ShortDescription = "Local real estate experts specializing in central Trondheim.",
LogoUrl = "https://cdn.example.com/logo-trondheim.png",
HeaderImageUrl = "https://cdn.example.com/trondheim-header.jpg",
PriceListUrl = "/PriceList Trondheim.pdf",
VideoUrl = "https://player.vimeo.com/video/123456789",
ImageTimestamp = DateTime.Parse("2025-10-25T10:30:00Z"),
// Publishing, Status and Service Area
WebPublish = true,
IsActive = true,
IsRentalSpecialist = true,
Order = 5,
ServiceAreaPostalCodes = new List<string> { "7011", "7013", "7042", "7043" },
// Origin Data
CustomData = new Dictionary<string, object>
{
{ "VitecAvtaleNr", "501" },
{ "InternalDivisionCode", "TRD01" }
}
};
// Employee ID References (Using IDs that link to a separate Employees collection)
department.ManagingDirectorIds = new List<string> { "EMP-1001" };
department.ResponsibleBrokerIds = new List<string> { "EMP-1002" };
department.DepartmentManagerIds = new List<string> { "EMP-1003" };
// Add Images
department.Images = new ImageCollection();
department.Images.Add(new Image
{
Id = "OFF-4001",
OriginalUrl = "https://cdn.example.com/office-facade.jpg",
Filename = "facade.jpg",
FileExtension = "jpg",
Caption = "Office exterior, summer 2025",
AltText = "Modern office facade with glass windows in Trondheim.",
Category = "Office Facade",
Order = 1,
Width = 1920,
Height = 1080,
LastModifiedOrigin = DateTime.Parse("2025-10-25"),
LastModifiedLocal = DateTime.Parse("2025-10-25T10:30:00Z")
});
department.Images.Add(new Image
{
Id = "OFF-4002",
OriginalUrl = "https://cdn.example.com/interior.jpg",
Filename = "interior.jpg",
FileExtension = "jpg",
Caption = "Reception area",
AltText = "Bright and open reception area with wooden furniture.",
Category = "Office Interior",
Order = 2,
Width = 1200,
Height = 800,
LastModifiedOrigin = DateTime.Parse("2025-10-25"),
LastModifiedLocal = DateTime.Parse("2025-10-25T10:30:00Z")
});
Working with Department Data
Example: Finding Departments by Location
// Get all departments in Trondheim
var trondheimDepts = departments.Where(d => d.Address.City == "Trondheim");
// Get departments serving a specific postal code
var deptsServing7011 = departments.Where(d =>
d.ServiceAreaPostalCodes != null &&
d.ServiceAreaPostalCodes.Contains("7011")
);
// Get active departments only
var activeDepts = departments.Where(d => d.IsActive);
// Get rental specialists
var rentalSpecialists = departments.Where(d => d.IsRentalSpecialist);
Example: Finding Related Entities
// Get all estates for this department
var departmentEstates = estates.Where(e => e.DepartmentId == department.DepartmentNumber);
// Get all employees in this department
var departmentEmployees = employees.Where(emp =>
emp.DepartmentIds != null &&
emp.DepartmentIds.Contains(department.Id)
);
// Get the managing director employee
if (department.ManagingDirectorIds.Any())
{
var managingDirector = GetEmployeeById(department.ManagingDirectorIds.First());
}
Relationship to Other Models
Department → Estate (One-to-Many)
Estates reference the department via DepartmentId:
Department → Employee (Many-to-Many)
Employees can belong to multiple departments:
Key employees are also referenced directly in the department:
department.ManagingDirectorIds = new List<string> { "EMP-1001" };
department.ResponsibleBrokerIds = new List<string> { "EMP-1002" };
department.DepartmentManagerIds = new List<string> { "EMP-1003" };
Department → Project (One-to-Many)
Projects reference the department handling them:
Download
- Download Department.cs - Complete C# source code
Related Pages
- Overview - High-level overview of the Department model
- Shared Classes - Reusable classes documentation
- Employee Model - Learn about employees
- Estate Model - Learn about estates
- Project Model - Learn about projects