VOOZH about

URL: https://www.nuget.org/packages/DragonFly.Generator/

โ‡ฑ NuGet Gallery | DragonFly.Generator 1.0.37


๏ปฟ

๐Ÿ‘ Image
DragonFly.Generator 1.0.37

dotnet add package DragonFly.Generator --version 1.0.37
 
 
NuGet\Install-Package DragonFly.Generator -Version 1.0.37
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DragonFly.Generator" Version="1.0.37" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DragonFly.Generator" Version="1.0.37" />
 
Directory.Packages.props
<PackageReference Include="DragonFly.Generator" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DragonFly.Generator --version 1.0.37
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DragonFly.Generator, 1.0.37"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DragonFly.Generator@1.0.37
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DragonFly.Generator&version=1.0.37
 
Install as a Cake Addin
#tool nuget:?package=DragonFly.Generator&version=1.0.37
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

DragonFly ยป Headless ASP.NET Core CMS + Blazor

๐Ÿ‘ License: MIT

Package Release
DragonFly.Core ๐Ÿ‘ NuGet
DragonFly.AspNetCore ๐Ÿ‘ NuGet
DragonFly.API ๐Ÿ‘ NuGet
DragonFly.Client ๐Ÿ‘ NuGet
DragonFly.Generator ๐Ÿ‘ NuGet
DragonFly.ImageWizard ๐Ÿ‘ NuGet
DragonFly.MongoDB ๐Ÿ‘ NuGet
DragonFly.Identity ๐Ÿ‘ NuGet
DragonFly.ApiKeys ๐Ÿ‘ NuGet

Features

  • Define schema with custom fields
  • Create, update, delete and publish/unpublish content items based on schema
    • Create new Fields with FieldGenerator
  • Create typed content items with ModelGenerator
  • BlockField for structured page content
    • TextBlock, HtmlBlock, ColumnBlock, GridBlock, AssetBlock, YouTubeBlock, CodeBlock,..
  • Asset management
    • Folder tree
    • Asset metadata like ImageMetadata and PdfMetadata
      • Use IAssetProcessing after asset upload
    • Create thumbnails for image and pdf files with ImageWizard
  • REST API
  • Permissions for content, schema, asset, asset folder, webhooks
    • Dynamic permissions for every schema
  • Background tasks
  • WebHooks
  • MongoDB storage
    • Create proxies with ProxyGenerator
  • Admin interface with Blazor

Getting started

Prerequisites

Create a new project from template

To use the project template you need first to download and install it from NuGet.

dotnet new install DragonFly.Templates

After this you can create the project with:

dotnet new DragonFly

If you have a remote MongoDB instance, you need to add some appsettings:

"MongoDB": {
 "Hostname": "localhost",
 "Database": "DragonFly_App",
 "Port": 27017,
 "Username": "",
 "Password": ""
 },

Use source generators to avoid reflection

  • FieldGenerator
  • ModelGenerator
  • ProxyGenerator

Supported fields

  • StringField
  • FloatField
  • BoolField
  • AssetField
  • ReferenceField
  • ComponentField
  • ArrayField
  • DateField
  • IntegerField
  • ColorField
  • GeolocationField
  • SlugField
  • XmlField
  • HtmlField
  • BlockField (HeadingBlock, TextBlock, HtmlBlock, CodeBlock, ContainerBlock, ColumnBlock, AssetBlock, ReferenceBlock, GridBlock,..)

How to create new content schema and content item

IContentStorage contentStorage = ...;//use MongoStorage or ClientContentService (http client)

//create brand schema
ContentSchema schemaBrand = new ContentSchema("Brand")
 .AddString("Name")
 .AddSlug("Slug")
 .AddTextArea("Description");

//Define schema for product
ContentSchema schemaProduct = new ContentSchema("Product")
 .AddReference("Brand")
 .AddString("Name", options => options.IsRequired = true)
 .AddSlug("Slug")
 .AddBool("IsAvailable", options => options.DefaultValue = true)
 .AddFloat("Price")
 .AddTextArea("Description", options => options.MaxLength = 255)
 .AddArray("Attributes", options => options
 .AddString("Name")
 .AddString("Value"));

await contentStorage.CreateAsync(schemaProduct);

//create product by schema
ContentItem contentProduct = schemaProduct
 .CreateContent()
 .SetReference("Brand", new ContentItem(Guid.Parse(""), schemaBrand))
 .SetString("Name", "ProductA")
 .SetBool("IsAvailable", true)
 .SetFloat("Price", 9.99)
 .SetTextArea("Description", "...")
 .AddArrayItem("Attributes", schemaProduct, item => item
 .SetString("Name", "Size")
 .SetString("Value", "M"));

await contentStorage.CreateAsync(contentProduct);

Create typed content

DragonFly.Generator

[ContentItem]
public partial class BlogPost
{
 [DateField(Required = true)]
 public partial DateTime? Date { get; set; }

 [StringField(Required = true, Searchable = true, ListField = true, MinLength = 8, MaxLength = 512)]
 public partial string? Title { get; set; }

 [TextField]
 public partial string? Description { get; set; }

 [SlugField(Required = true, Index = true)]
 public partial string? Slug { get; set; }

 [AssetField(ListField = true, ShowPreview = true)]
 public partial AssetField Image { get; set; }

 [BlockField]
 public partial BlockField MainContent { get; set; }
}
Register typed content
builder.Services.AddDragonFly()
 .AddModels(x => x.Add<BlogPost>()); 
Use queries for typed content
//get all items
var result = await ContentStorage.QueryAsync<BlogPostModel>(x => x
 .Published(true)
 .Top(10)
 .Slug(x => x.Slug, "my-product")
 .Integer(x => x.Quantity, 10, NumberQueryType.Equal)
 .String(x => x.Title, "Test", StringQueryType.Equal)
);

BackgroundTask

For long running jobs you can use the BackgroundTaskManager.

IBackgroundTaskManager taskManager = app.Services.GetRequiredService<IBackgroundTaskManager>();
taskManager.Start("Test", async ctx => await Task.Delay(TimeSpan.FromSeconds(60), ctx.CancellationToken));

DragonFly.AspNetCore

builder.Services.Configure<DragonFlyOptions>(Configuration.GetSection("General"));
builder.Services.Configure<MongoDbOptions>(Configuration.GetSection("MongoDB"));

//add DragonFly services
builder.Services.AddDragonFly(x => x
 .AddImageWizard(requireAuthorization: false)
 .AddRestApi()
 .AddMongoDbStorage()
 .AddMongoDbIdentity()
 .AddApiKeys());

var app = builder.Build();

//init DragonFly
await app.InitDragonFlyAsync();

if (env.IsDevelopment())
{
 app.UseDeveloperExceptionPage();
 app.UseWebAssemblyDebugging();
}

app.UseDragonFly();
app.UseDragonFlyManager();
app.UseRouting();
app.Run();

DragonFly.Client (Blazor)

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<DragonFly.App.Client.App>("app");

//Register DragonFly components
builder.AddDragonFlyClient(x => x
 .AddRestClient()
 .AddIdentity()
 .AddApiKeys());

WebAssemblyHost host = builder.Build();

await host.InitDragonFlyAsync();
await host.RunAsync();
Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.37 271 8/14/2025
1.0.35 252 6/1/2025
1.0.34 253 5/5/2025
1.0.31 594 3/24/2025
1.0.30 575 3/24/2025
1.0.29 571 3/24/2025
1.0.28 221 2/25/2025
1.0.27 223 2/5/2025
1.0.26 223 1/28/2025
1.0.25 242 1/2/2025
1.0.24 216 12/30/2024
1.0.22 234 11/19/2024
1.0.21 214 11/19/2024
1.0.20 218 11/19/2024
1.0.19 220 11/18/2024
1.0.18 217 11/17/2024
1.0.17 207 11/17/2024
1.0.15 283 4/27/2024
1.0.14 352 3/19/2024
1.0.13 307 3/19/2024
Loading failed