Escali License control 1
Escali.LicenseControl.DataAccess.Services.CustomerService Klasse Referanse

CustomerService class inserts and updates Customer in the Database Mer...

Public medlemsfunksjoner

 CustomerService (DataContext db)
 
async Task< List< Customer > > GetAllCustomers (int? id=null)
 Read all Customers from database Mer...
 
async Task< CustomerGetCustomerById (int id)
 Read one Customer with id from database Mer...
 
async Task< CustomerAddCustomer (Customer customer)
 Adds a Customer to the database Mer...
 
async Task< CustomerUpdateCustomer (Customer customer)
 Updates changes on a Customer in the database Mer...
 
async Task< CustomerDeactivateCustomer (int id)
 Deactivated a Customer by setting IsActive attribute to false Mer...
 
async Task< CustomerActivateCustomer (int id)
 Activates a Customer by setting IsActive attribute to true Mer...
 
async Task< int > GetRegionSeq (Region region)
 Checks in DB if it already exists a combination of area and country. Mer...
 

Private medlemsfunksjoner

async Task< bool > CustomerRegionIsChanged (int? regionSeq, Region region)
 

Private attributter

readonly DataContext _db
 

Detaljert beskrivelse

CustomerService class inserts and updates Customer in the Database

Definisjon på linje 13 i filen CustomerService.cs.

Konstruktør- & destruktør-dokumentasjon

◆ CustomerService()

Escali.LicenseControl.DataAccess.Services.CustomerService.CustomerService ( DataContext  db)

Definisjon på linje 17 i filen CustomerService.cs.

Medlemsfunksjon-dokumentasjon

◆ ActivateCustomer()

async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.ActivateCustomer ( int  id)

Activates a Customer by setting IsActive attribute to true

Parametre
id
Returnerer
Updated Customer
Unntak
NullReferenceExceptionThrown if id does not match a Customer id in the database

Definisjon på linje 190 i filen CustomerService.cs.

◆ AddCustomer()

async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.AddCustomer ( Customer  customer)

Adds a Customer to the database

Parametre
segment
Returnerer

Customer Entity

Null if a Customer is found with same CustomerName

Unntak
DbUpdateConcurrencyExceptionDatabase: not updated database before new update

Definisjon på linje 82 i filen CustomerService.cs.

◆ CustomerRegionIsChanged()

async Task< bool > Escali.LicenseControl.DataAccess.Services.CustomerService.CustomerRegionIsChanged ( int?  regionSeq,
Region  region 
)
private

Definisjon på linje 207 i filen CustomerService.cs.

◆ DeactivateCustomer()

async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.DeactivateCustomer ( int  id)

Deactivated a Customer by setting IsActive attribute to false

Parametre
id
Returnerer
Updated Customer
Unntak
NullReferenceExceptionThrown if id does not match a Customer id in the database

Definisjon på linje 174 i filen CustomerService.cs.

◆ GetAllCustomers()

async Task< List< Customer > > Escali.LicenseControl.DataAccess.Services.CustomerService.GetAllCustomers ( int?  id = null)

Read all Customers from database

Returnerer
A List of Customers

Definisjon på linje 26 i filen CustomerService.cs.

◆ GetCustomerById()

async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.GetCustomerById ( int  id)

Read one Customer with id from database

Parametre
id
Returnerer
Customer with corresponding id

<return> Null if id not found </return>

Definisjon på linje 69 i filen CustomerService.cs.

◆ GetRegionSeq()

async Task< int > Escali.LicenseControl.DataAccess.Services.CustomerService.GetRegionSeq ( Region  region)

Checks in DB if it already exists a combination of area and country.

Parametre
region
Returnerer
Returns primary key if combination exists. Not existing combination - creates new region entity and return primary key

Definisjon på linje 219 i filen CustomerService.cs.

◆ UpdateCustomer()

async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.UpdateCustomer ( Customer  customer)

Updates changes on a Customer in the database

Parametre
user
Returnerer

The updated Customer entity

Null if Customer with CustomerName already exist

Unntak
DbUpdateConcurrencyExceptionDatabase: not updated database before new update

Definisjon på linje 113 i filen CustomerService.cs.

Medlemsdata-dokumentasjon

◆ _db

readonly DataContext Escali.LicenseControl.DataAccess.Services.CustomerService._db
private

Definisjon på linje 15 i filen CustomerService.cs.


Dokumentasjonen for denne klasse ble generert fra følgende fil: