Skip to content

PamsLinqDataContext

reference
1 min readUpdated

Kind: Class

Source: Pams/Data/Pams.Data/PamsLinq5.designer.cs (line 26)

Part of: Pams

PamsLinqDataContext is a LINQ to SQL data context generated in Pams/Data/Pams.Data/PamsLinq5.designer.cs. It exposes table mappings for lookup and audit entities, allowing application code to query and persist records such as currencies, document types, nationalities, and database logs.

Diagram

mermaid
graph LR
  Context[PamsLinqDataContext]

  Context --> Currencies[Currency]
  Context --> DBLogs[DBLog]
  Context --> DBLogUsers[DBLogUser]
  Context --> DocumentTypes[DocumentType]
  Context --> EmailAddressTypes[EmailAddressType]
  Context --> Genders[Gender]
  Context --> Nationalities[Nationality]
  Context --> PhoneNumberTypes[PhoneNumberType]
  Context --> ReasonTypes[ReasonType]
  Context --> SerialTypes[SerialType]

Usage

ts
type Currency = {
  id: string;
  code: string;
  name: string;
};

async function loadCurrencies(): Promise<Currency[]> {
  const response = await fetch("/api/lookups/currencies");

  if (!response.ok) {
    throw new Error("Unable to load currencies.");
  }

  return response.json();
}

const currencies = await loadCurrencies();
console.log(currencies.map((currency) => currency.code));

AI Coding Instructions

  • Treat PamsLinqDataContext as the database boundary for LINQ to SQL queries and updates.
  • Query lookup tables such as Currencies, Genders, and Nationalities through their mapped Table<T> members.
  • Keep changes to PamsLinq5.designer.cs limited; regenerate the designer file when the database mapping changes.
  • Submit pending inserts, updates, and deletes through the data context's change submission flow.
  • Avoid exposing LINQ entity types directly to JavaScript clients; map them to API response models.

Relationships

  • IMPORTS → Comment
  • IMPORTS → Status

Used by

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

Imported by (353)

  • FilesControllerPams/API/Pams.API/Controllers/Common/FilesController.cs:27
  • UnitOfWorkPams/Logic/Pams.Business/Component/UnitOfWork.cs:12
  • EndUserPams/Logic/Pams.Business/Domain/Import/ImportDomain.cs:3891
  • 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

…and 345 more.

Was this page helpful?

Download as PDF