Skip to content

Commit

Permalink
Models
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbegent committed Nov 11, 2024
1 parent 2361442 commit 23c1ff4
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 69 deletions.
Binary file modified TestProject/umbraco/Data/Umbraco.sqlite.db
Binary file not shown.
16 changes: 8 additions & 8 deletions TestProject/umbraco/models/File.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder.Embedded v13.3.0+a325ba3
// Umbraco.ModelsBuilder.Embedded v13.3.0+5b46c71
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
Expand All @@ -24,15 +24,15 @@ public partial class File : PublishedContentModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const string ModelTypeAlias = "File";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const PublishedItemType ModelItemType = PublishedItemType.Media;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
=> PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public static IPublishedPropertyType GetModelPropertyType<TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression<Func<File, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
Expand All @@ -52,22 +52,22 @@ public File(IPublishedContent content, IPublishedValueFallback publishedValueFal
///<summary>
/// Size: in bytes
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[ImplementPropertyType("umbracoBytes")]
public virtual long UmbracoBytes => this.Value<long>(_publishedValueFallback, "umbracoBytes");

///<summary>
/// Type
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("umbracoExtension")]
public virtual string UmbracoExtension => this.Value<string>(_publishedValueFallback, "umbracoExtension");

///<summary>
/// File
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("umbracoFile")]
public virtual string UmbracoFile => this.Value<string>(_publishedValueFallback, "umbracoFile");
Expand Down
10 changes: 5 additions & 5 deletions TestProject/umbraco/models/Folder.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder.Embedded v13.3.0+a325ba3
// Umbraco.ModelsBuilder.Embedded v13.3.0+5b46c71
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
Expand All @@ -24,15 +24,15 @@ public partial class Folder : PublishedContentModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const string ModelTypeAlias = "Folder";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const PublishedItemType ModelItemType = PublishedItemType.Media;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
=> PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public static IPublishedPropertyType GetModelPropertyType<TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression<Func<Folder, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
Expand Down
12 changes: 6 additions & 6 deletions TestProject/umbraco/models/Homepage.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder.Embedded v13.3.0+a325ba3
// Umbraco.ModelsBuilder.Embedded v13.3.0+5b46c71
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
Expand All @@ -24,15 +24,15 @@ public partial class Homepage : PublishedContentModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const string ModelTypeAlias = "homepage";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
=> PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public static IPublishedPropertyType GetModelPropertyType<TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression<Func<Homepage, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
Expand All @@ -52,7 +52,7 @@ public Homepage(IPublishedContent content, IPublishedValueFallback publishedValu
///<summary>
/// Skrivlet
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("content")]
public virtual global::Umbraco.Community.SkrivLet.SkrivLetModel Content => this.Value<global::Umbraco.Community.SkrivLet.SkrivLetModel>(_publishedValueFallback, "content");
Expand Down
20 changes: 10 additions & 10 deletions TestProject/umbraco/models/Image.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder.Embedded v13.3.0+a325ba3
// Umbraco.ModelsBuilder.Embedded v13.3.0+5b46c71
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
Expand All @@ -24,15 +24,15 @@ public partial class Image : PublishedContentModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const string ModelTypeAlias = "Image";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const PublishedItemType ModelItemType = PublishedItemType.Media;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
=> PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public static IPublishedPropertyType GetModelPropertyType<TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression<Func<Image, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
Expand All @@ -52,37 +52,37 @@ public Image(IPublishedContent content, IPublishedValueFallback publishedValueFa
///<summary>
/// Size: in bytes
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[ImplementPropertyType("umbracoBytes")]
public virtual long UmbracoBytes => this.Value<long>(_publishedValueFallback, "umbracoBytes");

///<summary>
/// Type
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("umbracoExtension")]
public virtual string UmbracoExtension => this.Value<string>(_publishedValueFallback, "umbracoExtension");

///<summary>
/// Image
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("umbracoFile")]
public virtual global::Umbraco.Cms.Core.PropertyEditors.ValueConverters.ImageCropperValue UmbracoFile => this.Value<global::Umbraco.Cms.Core.PropertyEditors.ValueConverters.ImageCropperValue>(_publishedValueFallback, "umbracoFile");

///<summary>
/// Height: in pixels
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[ImplementPropertyType("umbracoHeight")]
public virtual int UmbracoHeight => this.Value<int>(_publishedValueFallback, "umbracoHeight");

///<summary>
/// Width: in pixels
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[ImplementPropertyType("umbracoWidth")]
public virtual int UmbracoWidth => this.Value<int>(_publishedValueFallback, "umbracoWidth");
}
Expand Down
12 changes: 6 additions & 6 deletions TestProject/umbraco/models/Member.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder.Embedded v13.3.0+a325ba3
// Umbraco.ModelsBuilder.Embedded v13.3.0+5b46c71
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
Expand All @@ -24,15 +24,15 @@ public partial class Member : PublishedContentModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const string ModelTypeAlias = "Member";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const PublishedItemType ModelItemType = PublishedItemType.Member;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
=> PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public static IPublishedPropertyType GetModelPropertyType<TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression<Func<Member, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
Expand All @@ -52,7 +52,7 @@ public Member(IPublishedContent content, IPublishedValueFallback publishedValueF
///<summary>
/// Comments
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("umbracoMemberComments")]
public virtual string UmbracoMemberComments => this.Value<string>(_publishedValueFallback, "umbracoMemberComments");
Expand Down
60 changes: 60 additions & 0 deletions TestProject/umbraco/models/SkrivLet.generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder.Embedded v13.3.0+5b46c71
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Linq.Expressions;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Infrastructure.ModelsBuilder;
using Umbraco.Cms.Core;
using Umbraco.Extensions;

namespace Umbraco.Cms.Web.Common.PublishedModels
{
/// <summary>SkrivLet</summary>
[PublishedModel("skrivLet")]
public partial class SkrivLet : PublishedElementModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const string ModelTypeAlias = "skrivLet";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
=> PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[return: global::System.Diagnostics.CodeAnalysis.MaybeNull]
public static IPublishedPropertyType GetModelPropertyType<TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression<Func<SkrivLet, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
#pragma warning restore 0109

private IPublishedValueFallback _publishedValueFallback;

// ctor
public SkrivLet(IPublishedElement content, IPublishedValueFallback publishedValueFallback)
: base(content, publishedValueFallback)
{
_publishedValueFallback = publishedValueFallback;
}

// properties

///<summary>
/// SkrivLet
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+5b46c71")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("mainContent")]
public virtual global::Umbraco.Community.SkrivLet.SkrivLetModel MainContent => this.Value<global::Umbraco.Community.SkrivLet.SkrivLetModel>(_publishedValueFallback, "mainContent");
}
}
Loading

0 comments on commit 23c1ff4

Please sign in to comment.