What's new in Intent Architect (November / December 2023)
Welcome to the 2023 Christmas edition of highlights of What's New in Intent Architect.
- Highlights
- .NET 8 support - All modules have been updated to support .NET 8.
- OData Query support - Leverage OData query functionality on your ASP.NET Core controllers.
- Improvements to C# statement merging - Improvements to heuristics and instructions for controlling statement merging behaviour within method bodies.
- AutoMapper Projection support on EF repositories - Added support for AutoMapper Projections on the EF repository pattern.
- EF repository enhancements - Added several overloads to EF repositories to make LINQ features more available.
- More updates
- "Indented" and "data" template file builders - More quickly author templates for files such as JSON and YAML and in a way that can be easily extended by other modules.
- HttpClient Proxy authorization propagation - Service proxies mapped to secured services will propagate the callers security context.
- NET 6+ Simple Hosting Model - Support for
Use minimal hosting model
andUse top-level statements
on.NET Project
s. - Account Controller improvements - Multiple improvements to the the refresh token endpoint.
- RabbitMQ Trigger for Azure Functions added - RabbitMQ Triggers for queue integration now available on the Azure Functions module.
- EF Bulk Operations module - Extends EF repositories to support Bulk Operations.
- Documentation on Designer Scripting with JavaScript - New article that provides and introduction to and explains the designer scripting capabilities of Intent Architect.
- Synchronous method support on EF repositories - Optionally add synchronous repository method overloads through an application setting.
- Email Address Validation - "Email Address" checkbox property added to the "Validation" stereotype.
- Prevent updates to Basic Auditing "created" values - Possible updates to
CreatedBy
andCreatedDate
values are now blocked. - IApplicationDbContext option now available - It is now possible to expose Entity Framework's
DbSet
s to your application's "Application" layer. - Entity Framework split queries support - It is now possible enable split queries for an application.
- AutoMapper version upgrade - Upgraded various AutoMapper dependencies to the latest version.
Update details
.NET 8 support
All applicable modules have been updated to support .NET 8, in particular:
- The Visual Studio Designer now allows selecting .NET 8 as the SDK version.
- Many and all applicable modules have been updated so that when .NET 8 is used in the Visual Studio designer, generated
.csproj
files will reference .NET 8 versions of Microsoft NuGet packages.
Available from:
- Intent.VisualStudio.Projects 3.5.0
OData Query support
This modules adds OData Query support to your CQRS paradigm service endpoints, specifically Query
s.
For more detail, refer to the module documentation.
Available from:
- Intent.AspNetCore.ODataQuery 1.0.0
C# Code Management statement block merging improvements
Improvements have been made to code management within statement blocks.
- For most statement types, old statements will now be removed from existing files when a template's output has changed.
- Instead of using
// [IntentMatch("…")]
above statements to control how they match with a statement generated by a template, one should now use the more intuitive// [IntentFully(Match = "…")]
or// [IntentIgnore(Match = "…")]
instructions.
For more information on controlling statement code management behaviour, refer to our Docs article.
Available from:
- Intent.OutputManager.RoslynWeaver 4.4.0
AutoMapper Projection support on EF repositories
The AutoMapper now has Projection support to Entity Framework Core Repositories.
The following methods will query the relevant Entity
and the use AutoMapper's ProjectTo functionality to materialize the results.
Available from:
- Intent.Application.AutoMapper 5.0.0
EF repository enhancements
Added several overloads to EF repositories to make generic LINQ features easier to express, for example OrderBy, Include, etc.
Available from:
- Intent.EntityFrameworkCore.Repositories 4.4.0
Indented and Data File builders for templates
New IndentedFile
and DataFile
classes have been introduced which work in essentially the same way as the CSharpFile
class where they employ use of a builder pattern to allow easy authoring of templates.
Both of these new classes should be immediately familiar to anyone who has used the CSharpFile
builder when authoring templates, they add an interface to the template allowing other modules to access them for potential manipulation without requiring a hard dependency. Furthermore, metadata can be added to the different parts of the files for further introspection and structure.
The IndentedFile
class is used for authoring of simple "indented" files, it has a WithItems("…")
and a WithContent("…")
method. The former will increase indentation and the latter will add content at the current indentation.
The Datafile
class is used for authoring of structured data files such as JSON and YAML and has methods such as WithArray("…")
, WithObject("…")
and WithValue("…")
.
To get started, ensure you have the latest module builder installed and create a New File Template:
Then in the properties pane on the right, select the desired Template Method:
Once you've run the Software Factory, author your template:
public class YamlTestTemplate : IntentTemplateBase<object>, IDataFileBuilderTemplate
{
[IntentManaged(Mode.Fully)]
public const string TemplateId = "CustomModule.YamlTest";
[IntentManaged(Mode.Fully, Body = Mode.Ignore)]
public YamlTestTemplate(IOutputTarget outputTarget, object model = null) : base(TemplateId, outputTarget, model)
{
DataFile = new DataFile($"YamlTest")
.WithYamlWriter()
.WithRootObject(this, @object =>
{
@object
.WithObject("objectField", @object => {
@object.WithValue("field1", "value1");
@object.WithValue("field1", "value2");
})
.WithArray("arrayField", array => {
array.WithValue("value1");
array.WithValue("value2");
})
.WithValue("multilineField", """
A multiline statement's first line.
Additional line.
After a blank line.
""")
;
});
}
[IntentManaged(Mode.Fully)]
public IDataFile DataFile { get; }
[IntentManaged(Mode.Fully)]
public override ITemplateFileConfig GetTemplateFileConfig() => DataFile.GetConfig();
[IntentManaged(Mode.Fully)]
public override string TransformText() => DataFile.ToString();
}
Available from:
- Intent.ModuleBuilder 3.7.0
- Intent.Common 3.5.0
HttpClient Proxy authorization propagation
When modeling Service Proxies which reference Services that require authentication, the module will now configure the Proxies such that they will forward your current HttpContext Authorization header along with the proxy request, if no Authorization header is present.
Available from:
- Intent.Integration.HttpClients 5.0.8
- Intent.Dapr.AspNetCore.ServiceInvocation 2.1.0
.NET 6+ Simple Hosting Model
It is now possible to specify Use minimal hosting model
and Use top-level statements
on .NET Project
s when their SDK
is set to Microsoft.NET.Sdk.Web
:
.
Note
Installing the updated version of the Intent.VisualStudio.Projects
module will cause several other module to have their versions bumped as they needed to be updated to correctly update either Startup.cs
or Program.cs
depending on the settings chosen.
Available from:
- Intent.VisualStudio.Projects 3.5.0
Account Controller improvements
The Account Controller's refresh token endpoint has been improved in the following ways to be more inline with Microsoft's identity management API introduced with .NET 8:
- The
RefreshToken
token endpoint has had its name changed toRefresh
, verb changed fromGET
toPOST
and theRefreshToken
is now to be supplied in the body of the request. - The access token is no longer supplied in the body or query string and the endpoint is instead decorated with an
[Authorized]
attribute meaning that, as usual for secured endpoints, the access token will now need to supplied in the header. - When using the refresh token endpoint, the returned access token now has its claims updated with the latest for the user.
Available from:
- Intent.AspNetCore.Identity.AccountController 3.0.1
RabbitMQ Trigger for Azure Functions added
We have made an improvement on the Azure Functions module, which now includes the ability to select RabbitMQ Triggers for queue integration. This feature allows developers to create functions that are triggered by messages in a RabbitMQ queue, providing a seamless integration between Azure Functions and RabbitMQ.
Available from:
- Intent.AzureFunctions 4.0.13
EF Bulk Operations module
This module provides patterns for doing Bulk data operation with Entity Framework Core using EFCore BulkExtensions
.
For more detail, refer to the module documentation.
Available from:
- Intent.EntityFrameworkCore.BulkOperations 1.0.0
Documentation on Designer Scripting with JavaScript
We've created an article that introduces and explains the designer scripting capabilities of Intent Architect which provides a scripting editor for automating various operations, such as creating elements and associations, and offers TypeScript declarations for understanding the available functions.
The article also explains how to use event-triggered scripts for associations and elements, enabling developers to execute custom logic when specified events occur.
The new article is now available for you to read and please share with us whether you found this article helpful. Click here to read it.
Email Address Validation
An "Email Address" checkbox property has been added to the "Validation" stereotype, when checked it applies the Email Validator in FluentValidation modules and the EmailAddressAttribute in DataAnnotations modules.
Available from:
- Intent.Application.FluentValidation 3.8.7
- Intent.Application.FluentValidation.Dtos 3.7.3
- Intent.Application.MediatR.FluentValidation 4.5.0
- Intent.Blazor.HttpClients.Dtos.DataAnnotations 1.0.1
- Intent.Blazor.HttpClients.Dtos.FluentValidation 1.0.3
Synchronous method support on EF repositories
Added support for Synchronous versions of EF repository methods. This option is off by default but can be opted into through application settings, Database Settings -> Add synchronous methods to repositories
.
Available from:
- Intent.EntityFrameworkCore.Repositories 4.4.0
Prevent Basic Auditing's "created" column values from being updated later
The Basic Auditing pattern now ensures that any attempted changes to the CreatedBy
and CreatedDate
properties on entities being updated are discarded before being saved to the database.
Available from:
- Intent.Entities.BasicAuditing 1.0.2
IApplicationDbContext interface
It is now possible to enable generation of an IApplicationDbContext
interface for use in an application's "Application" layer to allow access to Entity Framework's DbSet
s. See the module documentation for more information.
Available from:
- Intent.EntityFrameworkCore 4.5.0
Enable Entity Framework split queries
It is now possible to enable split queries globally by selecting the Enable split queries globally application setting.
Available from:
- Intent.EntityFrameworkCore 4.5.0
AutoMapper version upgrade
AutoMapper modules updated to use the latest AutoMapper NuGet packages.
Available from:
- Intent.Application.AutoMapper 5.0.0
- Intent.Application.DependencyInjection.AutoMapper 4.0.0