Skip to content

EntityBase

reference
1 min readUpdated

Kind: Class

Source: Pams/Logic/Pams.Business/Entity/EntityBase.cs (line 103)

Part of: Pams

EntityBase is a shared model class that tracks whether an entity has an associated object through HasObject and whether it is marked for deletion through MarkDeleted. Business-layer entity types can inherit or compose this state when applying persistence and deletion rules.

Diagram

mermaid
graph LR
    Entity[EntityBase]
    HasObject[HasObject: bool]
    MarkDeleted[MarkDeleted: bool]

    Entity --> HasObject
    Entity --> MarkDeleted
    MarkDeleted --> DeletionFlow[Deletion handling]
    HasObject --> ObjectState[Associated object state]

Usage

ts
// TypeScript representation of the EntityBase state sent to or received from .NET.
type EntityBase = {
  HasObject: boolean;
  MarkDeleted: boolean;
};

const entity: EntityBase = {
  HasObject: true,
  MarkDeleted: false,
};

function shouldPersist(entity: EntityBase): boolean {
  return entity.HasObject && !entity.MarkDeleted;
}

if (shouldPersist(entity)) {
  console.log("Entity can be processed.");
}

AI Coding Instructions

  • Keep HasObject and MarkDeleted as boolean state fields when extending entity models.
  • Treat MarkDeleted as deletion state; do not assume the entity has already been removed from storage.
  • Check HasObject before performing operations that require an associated object.
  • Preserve field names when mapping this model to API payloads or client-side TypeScript types.

Used by

355 references from 355 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (355)

  • PersonUserBindingModelPams/Logic/Pams.Business/BindingModels/Security/PersonUserBindingModel.cs:7
  • AccountManagerTargetPams/Logic/Pams.Business/Entity/BookingTarget/AccountManagerTarget.cs:7
  • ForecastedBookingRulePams/Logic/Pams.Business/Entity/BookingTarget/ForecastedBookingRule.cs:7
  • MonthlyBacklogPams/Logic/Pams.Business/Entity/BookingTarget/MonthlyBacklog.cs:7
  • MonthlyForecastPams/Logic/Pams.Business/Entity/BookingTarget/MonthlyForecast.cs:7
  • MonthlyProductTypeBacklogPams/Logic/Pams.Business/Entity/BookingTarget/MonthlyProductTypeBacklog.cs:7
  • MonthlySalesForecastPams/Logic/Pams.Business/Entity/BookingTarget/MonthlySalesForecast.cs:7
  • MonthlyTargetPams/Logic/Pams.Business/Entity/BookingTarget/MonthlyTarget.cs:7

…and 347 more.

Was this page helpful?

Download as PDF