Note Onion - 2 - Application - NoteDto

Here is the source code for NoteDto.cs file it is placed in the Dtos directory of the Note.Application project.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System.ComponentModel.DataAnnotations;

namespace Note.Application.DTOs
{
// aka ViewModels
public class NoteDto
{

public NoteDto()
{
ApplicationKey = "";
ApplicationSubKey = "";
CompanyKey = "";
Dt = System.DateTime.Now;
Id = 0;
Note = "";
Who = "";
}


public long Id { get; set; }


[Required(ErrorMessage = "NoteViewModel.ApplicationKey is Required")]
[StringLength(255, ErrorMessage = "Maximum length for Application Key is 255 characters")]
public string ApplicationKey { get; set; }


[Required(ErrorMessage = "Application Subkey is Required")]
[StringLength(255, ErrorMessage = "Maximum length for Application SubKey is 255 characters")]
public string ApplicationSubKey { get; set; }


[Required(ErrorMessage = "Company Key is Required")]
[StringLength(255, ErrorMessage = "Maximum length for Company Key is 255 characters")]
public string CompanyKey { get; set; }


public DateTime Dt { get; set; }


//public long NoteTypeId { get; set; }

[Required(ErrorMessage = "NoteType Object is Required")]
public NoteTypeDto NoteTypeEntity { get; set; }


public string Note { get; set; }


[StringLength(40, ErrorMessage = "Maximum length for Who is 40 characters")]
public string Who { get; set; }

}

}