ContentSchedule Guid identifier

This commit is contained in:
Stephan
2018-11-14 13:59:53 +01:00
parent 3104b02db4
commit e08189cc25
5 changed files with 58 additions and 41 deletions

View File

@@ -13,7 +13,18 @@ namespace Umbraco.Core.Models
/// <summary>
/// Initializes a new instance of the <see cref="ContentSchedule"/> class.
/// </summary>
public ContentSchedule(int id, string culture, DateTime date, ContentScheduleAction action)
public ContentSchedule(string culture, DateTime date, ContentScheduleAction action)
{
Id = Guid.Empty; // will be assigned by document repository
Culture = culture;
Date = date;
Action = action;
}
/// <summary>
/// Initializes a new instance of the <see cref="ContentSchedule"/> class.
/// </summary>
public ContentSchedule(Guid id, string culture, DateTime date, ContentScheduleAction action)
{
Id = id;
Culture = culture;
@@ -25,7 +36,7 @@ namespace Umbraco.Core.Models
/// Gets the unique identifier of the document targeted by the scheduled action.
/// </summary>
[DataMember]
public int Id { get; }
public Guid Id { get; internal set; }
/// <summary>
/// Gets the culture of the scheduled action.

View File

@@ -74,14 +74,14 @@ namespace Umbraco.Core.Models
if (releaseDate.HasValue)
{
var entry = new ContentSchedule(0, culture, releaseDate.Value, ContentScheduleAction.Release);
var entry = new ContentSchedule(culture, releaseDate.Value, ContentScheduleAction.Release);
changes.Add(releaseDate.Value, entry);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, entry));
}
if (expireDate.HasValue)
{
var entry = new ContentSchedule(0, culture, expireDate.Value, ContentScheduleAction.Expire);
var entry = new ContentSchedule(culture, expireDate.Value, ContentScheduleAction.Expire);
changes.Add(expireDate.Value, entry);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, entry));
}