using System; namespace zero.Web.Models { public class EditModel : EditModel { } public class EditModel { /// /// Model /// public T Entity { get; set; } /// /// Meta data /// public EditMetaModel Meta { get; set; } = new EditMetaModel(); } public class EditMetaModel { /// /// Whether an entity of this type can be created /// public bool CanCreate { get; set; } /// /// Whether an entity of this type can be created in the shared app space /// public bool CanCreateShared { get; set; } /// /// Whether this entity can be edited or only viewed /// public bool CanEdit { get; set; } /// /// Whether this entity can be deleted /// public bool CanDelete { get; set; } /// /// Wehther this entity is application aware /// public bool IsAppAware { get; set; } /// /// Whether this entity can be shared across applications (only for IsAppAware=true) /// public bool CanBeShared { get; set; } public bool IsShared { get; set; } /// /// The change token maps to a database entity which holds ID and collection of the model to edit /// If these values do not match the entity on save it is rejected /// // TODO expiration expiry session.Advanced.GetMetadataFor(user)[Raven.Client.Constants.Documents.Metadata.Expires] = DateTime.UtcNow.AddMinutes(60); /// public string Token { get; set; } } public abstract class ObsoleteEditModel { /// /// Id of the entity /// public string Id { get; set; } /// /// Whether this entity is active /// public bool IsActive { get; set; } /// /// Whether this entity can be edited or only viewed /// public bool CanEdit { get; set; } /// /// Date of creation /// public DateTimeOffset CreatedDate { get; set; } /// /// Meta data for the entity /// public EditModelMeta Meta { get; set; } = new EditModelMeta(); } public class EditModelMeta { /// /// The change token maps to a database entity which holds ID and collection of the model to edit /// If these values do not match the entity on save it is rejected /// // TODO expiration expiry session.Advanced.GetMetadataFor(user)[Raven.Client.Constants.Documents.Metadata.Expires] = DateTime.UtcNow.AddMinutes(60); /// public string Token { get; set; } } }