Files
Umbraco-CMS/src/Umbraco.Abstractions/Models/Script.cs

31 lines
822 B
C#
Raw Normal View History

2018-06-29 19:52:40 +02:00
using System;
using System.Runtime.Serialization;
2019-05-27 11:45:35 +02:00
2018-06-29 19:52:40 +02:00
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a Script file
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class Script : File, IScript
2018-06-29 19:52:40 +02:00
{
public Script(string path)
: this(path, (Func<File, string>) null)
{ }
2019-05-27 11:45:35 +02:00
public Script(string path, Func<File, string> getFileContent)
2018-06-29 19:52:40 +02:00
: base(path, getFileContent)
{ }
/// <summary>
/// Indicates whether the current entity has an identity, which in this case is a path/name.
/// </summary>
/// <remarks>
/// Overrides the default Entity identity check.
/// </remarks>
public override bool HasIdentity => string.IsNullOrEmpty(Path) == false;
2018-06-29 19:52:40 +02:00
}
}