Escali License control 1
|
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< Customer > | GetCustomerById (int id) |
Read one Customer with id from database Mer... | |
async Task< Customer > | AddCustomer (Customer customer) |
Adds a Customer to the database Mer... | |
async Task< Customer > | UpdateCustomer (Customer customer) |
Updates changes on a Customer in the database Mer... | |
async Task< Customer > | DeactivateCustomer (int id) |
Deactivated a Customer by setting IsActive attribute to false Mer... | |
async Task< Customer > | ActivateCustomer (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 |
CustomerService class inserts and updates Customer in the Database
Definisjon på linje 13 i filen CustomerService.cs.
Escali.LicenseControl.DataAccess.Services.CustomerService.CustomerService | ( | DataContext | db | ) |
Definisjon på linje 17 i filen CustomerService.cs.
async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.ActivateCustomer | ( | int | id | ) |
Activates a Customer by setting IsActive attribute to true
id |
NullReferenceException | Thrown if id does not match a Customer id in the database |
Definisjon på linje 190 i filen CustomerService.cs.
async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.AddCustomer | ( | Customer | customer | ) |
Adds a Customer to the database
segment |
Customer Entity
Null if a Customer is found with same CustomerName
DbUpdateConcurrencyException | Database: not updated database before new update |
Definisjon på linje 82 i filen CustomerService.cs.
|
private |
Definisjon på linje 207 i filen CustomerService.cs.
async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.DeactivateCustomer | ( | int | id | ) |
Deactivated a Customer by setting IsActive attribute to false
id |
NullReferenceException | Thrown if id does not match a Customer id in the database |
Definisjon på linje 174 i filen CustomerService.cs.
async Task< List< Customer > > Escali.LicenseControl.DataAccess.Services.CustomerService.GetAllCustomers | ( | int? | id = null | ) |
Read all Customers from database
Definisjon på linje 26 i filen CustomerService.cs.
async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.GetCustomerById | ( | int | id | ) |
Read one Customer with id from database
id |
<return> Null if id not found </return>
Definisjon på linje 69 i filen CustomerService.cs.
async Task< int > Escali.LicenseControl.DataAccess.Services.CustomerService.GetRegionSeq | ( | Region | region | ) |
Checks in DB if it already exists a combination of area and country.
region |
Definisjon på linje 219 i filen CustomerService.cs.
async Task< Customer > Escali.LicenseControl.DataAccess.Services.CustomerService.UpdateCustomer | ( | Customer | customer | ) |
Updates changes on a Customer in the database
user |
The updated Customer entity
Null if Customer with CustomerName already exist
DbUpdateConcurrencyException | Database: not updated database before new update |
Definisjon på linje 113 i filen CustomerService.cs.
|
private |
Definisjon på linje 15 i filen CustomerService.cs.