115
1
using System;
2
using System.Collections.Generic;
3
4
public class Program
5
{
6
public static void Main()
7
{
8
var product = new Product
9
{
10
Id = 1453,
11
Price = 1000M,
12
Stock = 0
13
};
14
15
product.Attach(new ProductPriceObserver());
16
product.Attach(new ProductStockObserver());
17
18
product.UpdatePrice(999M);
19
product.UpdateStock(10);
20
}
21
}
22
23
public record ProductObserverArgs
24
{
Cached Result
[
{
"performanceLevels": [
{
"performanceLevel_1": {
"title": {
"data-type": "string",
"source": "column",
"source-column": "title-column",
"default": "N/A"
},
"version": {
"data-type": "int",
"source": "column",
"source-column": "version-column",
"default": "1"
},
"threeLevels": {
"version": {
"data-type": "int",
"source": "column",
"source-column": "version-column",
"default": "1"
}
}
}
},
{
"performanceLevel_2": {
"title": {
"data-type": "string",
"source": "column",
"source-column": "title-column",
"default": "N/A"
},
"version": {
"data-type": "int",
"source": "column",
"source-column": "version-column",
"default": "1"
}
}
}
]
}
]
------------------------------
Name: performanceLevels
SubMappers:
Name: performanceLevel_1
SubMappers:
Name: title
DataType: string
Source: column
SourceColumn: title-column
Default: N/A
Name: version
DataType: int
Source: column
SourceColumn: version-column
Default: 1
Name: threeLevels
SubMappers:
Name: version
DataType: int
Source: column
SourceColumn: version-column
Default: 1
Name: performanceLevel_2
SubMappers:
Name: title
DataType: string
Source: column
SourceColumn: title-column
Default: N/A
Name: version
DataType: int
Source: column
SourceColumn: version-column
Default: 1
{
"performanceLevels": [
{
"performanceLevel_1": {
"title": {
"data-type": "string",
"source": "column",
"source-column": "title-column",
"default": "N/A"
},
"version": {
"data-type": "int",
"source": "column",
"source-column": "version-column",
"default": "1"
},
"threeLevels": {
"version": {
"data-type": "int",
"source": "column",
"source-column": "version-column",
"default": "1"
}
}
}
},
{
"performanceLevel_2": {
"title": {
"data-type": "string",
"source": "column",
"source-column": "title-column",
"default": "N/A"
},
"version": {
"data-type": "int",
"source": "column",
"source-column": "version-column",
"default": "1"
}
}
}
]
}
]
------------------------------
Name: performanceLevels
SubMappers:
Name: performanceLevel_1
SubMappers:
Name: title
DataType: string
Source: column
SourceColumn: title-column
Default: N/A
Name: version
DataType: int
Source: column
SourceColumn: version-column
Default: 1
Name: threeLevels
SubMappers:
Name: version
DataType: int
Source: column
SourceColumn: version-column
Default: 1
Name: performanceLevel_2
SubMappers:
Name: title
DataType: string
Source: column
SourceColumn: title-column
Default: N/A
Name: version
DataType: int
Source: column
SourceColumn: version-column
Default: 1