Moved more abstractions of models

This commit is contained in:
Bjarke Berg
2019-05-27 11:45:35 +02:00
parent 408b00a737
commit dcf022ffaa
23 changed files with 13 additions and 40 deletions

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a Script file
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class Script : File
{
public Script(string path)
: this(path, (Func<File, string>) null)
{ }
public Script(string path, Func<File, string> getFileContent)
: 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
{
get { return string.IsNullOrEmpty(Path) == false; }
}
}
}