-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMigrations.cs
29 lines (25 loc) · 959 Bytes
/
Migrations.cs
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
using Etch.OrchardCore.CacheControl.Models;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
using System.Threading.Tasks;
namespace Etch.OrchardCore.CacheControl
{
public class Migrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterPartDefinitionAsync(nameof(CacheControlPart), builder => builder
.Attachable()
.WithDisplayName("Cache Control")
.WithDescription("Configure cache-control response header")
);
return 1;
}
}
}