-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPropertyMap.cs
More file actions
49 lines (42 loc) · 1.25 KB
/
PropertyMap.cs
File metadata and controls
49 lines (42 loc) · 1.25 KB
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
using System;
namespace Poco.Sql.NetCore
{
public class PropertyMap
{
public string PropertyName { get; private set; }
public string ColumnName { get; private set; }
public bool Required { get; private set; }
public bool Ignored { get; private set; }
public int MaxLength { get; private set; }
public Type FieldType { get; private set; }
public PropertyMap(string propertyName)
{
PropertyName = propertyName;
ColumnName = propertyName;
}
public PropertyMap HasColumnName(string columnName)
{
ColumnName = columnName;
return this;
}
public PropertyMap Ignore()
{
Ignored = true;
return this;
}
public PropertyMap IsRequired() //TODO: validate this property when building the query
{
return IsRequired(true);
}
public PropertyMap IsRequired(bool required)
{
Required = required;
return this;
}
public PropertyMap HasMaxLength(int maxLength) //TODO: validate this property when building the query
{
MaxLength = maxLength;
return this;
}
}
}