-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF.txt
More file actions
23 lines (19 loc) · 694 Bytes
/
Copy pathF.txt
File metadata and controls
23 lines (19 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
type Customer() =
inherit EntityBase<Customer>()
let mutable id = 0
let mutable name = ""
member this.Id
with get() = id
and set v = id <- v; base.OnPropertyChanged("Id")
[<MaxLength(16)>]
member this.Name
with get() = name
and set v = name <- v; base.OnPropertyChanged("Name")
let cus = new Customer(Id=1,Name="yo")
cus.Extensions.InitializeRules()
cus.Extensions.BrokenRules.Count
cus.Extensions.BrokenRules
|> Seq.iter (fun b -> printfn "%s" b.Message)
let rule = cus.Extensions.CreateValidationRule(@"Name.Contains(""a"")")
RuleExtensions.WithMessage(rule, "Name musi zawierac literke 'a'")
RuleExtensions.Start(rule)