-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathWidgetInstance.cs
More file actions
52 lines (38 loc) · 1.38 KB
/
WidgetInstance.cs
File metadata and controls
52 lines (38 loc) · 1.38 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
50
51
52
using System;
using System.ComponentModel.DataAnnotations;
using SimplCommerce.Infrastructure.Models;
namespace SimplCommerce.Module.Core.Models
{
public class WidgetInstance : EntityBase
{
public WidgetInstance()
{
CreatedOn = DateTimeOffset.UtcNow;
LatestUpdatedOn = DateTimeOffset.UtcNow;
}
[StringLength(450)]
public string Name { get; set; }
public DateTimeOffset CreatedOn { get; set; }
public DateTimeOffset LatestUpdatedOn { get; set; }
public DateTimeOffset? PublishStart { get; set; }
public DateTimeOffset? PublishEnd { get; set; }
[StringLength(450)]
public string WidgetId { get; set; }
public Widget Widget { get; set; }
public long WidgetZoneId { get; set; }
public WidgetZone WidgetZone { get; set; }
public int DisplayOrder { get; set; }
public string Data { get; set; }
public string HtmlData { get; set; }
/// <summary>
/// This property cannot be used to filter again DB because it don't exist in database
/// </summary>
public bool IsPublished
{
get
{
return PublishStart.HasValue && PublishStart.Value < DateTimeOffset.UtcNow && (!PublishEnd.HasValue || PublishEnd.Value > DateTimeOffset.UtcNow);
}
}
}
}