The summary below describes major new features, items of note and breaking changes in Quino. The full list of issues is also available for those with access to the Encodo issue tracker.
CoreServiceBase
, which extends the standard .NET ServiceBase
. The runner is available in the Encodo.Service
assembly.HttpApplicationBase
, especially in situations where the application fails to start. Error-page handling was also improved, including handling for Windows Event Log
errors.Encodo.Core
namespace to use annotations like NotNull
and CanBeNull
with parameters and results. (QNO-4508)Generated code now includes a property that returns a ValueListObject
for each enum
property in the metadata. For example, for a property named State
of type CoreState
, the generated code includes the former properties for the enum
and the foreign key backing it, but now also includes the ValueListObject
property. This new property provides easy access to the captions.
public CoreState State { … }
public ValueListObject StateObject { … }
public int? CoreStateIdId { … }
Improved the nant fix command in the default build tools to fix the assembly name as well. The build tools are available in bin/tools/build. See the src/demo/Demo.build
file for an example on how to use the Nant build scripts for your own solutions. To change the company name used by the “fix” command, for example, add the following task override:
<target name="fix.before">
<call target="fix.before.base"/>
<property name="InfoCompanyName" value="Foobar Corporation"/>
</target>
IntegrateRemotableMethods
to avoid a race condition with remote methods. Also improved the stability of the DataProvider
statistics. (QNO-4599)
TRight
has been removed from all classes and interfaces in the Encodo.Security.*
namespace. In order to fix this code, just remove the int
generic parameter wherever it was used. For example, where before you used the interface IUser<int>
, you should now use IUser
(QNO-4576).MetaAccessControl.DoGetAccessChecker()
has been renamed to MetaAccessControl.GetAccessChecker()
.Encodo.ServiceLocator.SimpleInjector.dll
to Encodo.Services.SimpleInjector.dll
and Quino.ServiceLocator.SimpleInjector.dll
to Quino.Services.SimpleInjector.dll
Also changed the namespace Quino.ServiceLocator
to Encodo.Quino.Services
.HttpApplicationBase.StartMetaApplication()
to CreateAndStartUpApplication()
.IMetaReadable
(e.g. Deleted
, Persisted
). The model will no longer validate until the properties have been renamed and the code regenerated. (QNO-4185)StandardIntRights
with integer constants and replaced it with StandardRights
with string constants.IAccessControl.Check()
and other related methods now accept a sequence of string rights rather than integers.IMetaConfiguration.ConfigureSession()
has been deprecated. The method will still be called but may have undesired side-effects, depending on why it was overridden. The common use was to initialize a custom AccessControl
for the session. Continuing to do so may overwrite the current user set by the default Winform startup. Instead, applications should use the IDataSessionAccessControlFactory
and IDataSessionFactory
to customize the data sessions and access controls returned for an application. In order to attach an access control, take care to only set your custom access control for sessions that correspond to your application model.[1]
internal class JobVortexDataSessionAccessControlFactory : DataSessionAccessControlFactory
{
public override IAccessControl CreateAccessControl(IDataSession session)
{
if (session.Application.Model.MetaId == JobVortexModelGenerator.ModelGuid)
{
return new JobVortexAccessControl(session);
}
return base.CreateAccessControl(session);
}
}
The default length of the UserModule.User.PasswordHash
property has been increased from 100 characters to 1000. This default is more sensible for implementations that use much longer validations tokens instead of passwords. To avoid the schema migration, revert the change by setting the property default length back to 0 in your application model, after importing the security module, as shown below.
var securityModule = Builder.Include<SecurityModuleGenerator>();
securityModule.Elements.Classes.User.Properties[
Encodo.Quino.Models.Security.Classes.SecurityUser.Fields.PasswordHash
].MaximumSize = 100;
Application.Credentials
has been removed. To fix references, retrieve the IUserCredentialsManager
from the service locator. For example, the following code returns the current user:
Session.Application.Configuration.ServiceLocator.GetInstance<IUserCredentialsManager>().Current
If your application uses the WinformMetaConfigurationTools.IntegrateWinformPackages()
or WinformDxMetaConfigurationTools.IntegrateWinformDxPackages()
, then the IDataSession.AccessControl.CurrentUser
will continue to be set correctly. If not, add the SingleUserApplicationConfigurationPackage
to your application’s configuration. The user in the remoting server will be set up correctly. Add the WebApplicationConfigurationPackage
to web applications in order to ensure that the current user is set up correctly for each request. (QNO-4596)
IDataSession.SyncRoot
has been removed as it was no longer needed or used in Quino itself. Sessions should not be used in multiple threads, so there is no need for a SyncRoot
. Code that uses it should be reworked to use a separate session for each thread.IMetaApplication.CreateSession()
to an extension method. Add Encodo.Quino.App
to the using clauses to fix any compile errors.IMetaApplication.DataProvider
; use IMetaApplication.Configuration.DataProvider
instead. (QNO-4604)ISchemaChange
and descendents has been completely removed. ISchemaAction
is no longer part of the external API, although it is still used internally. The ISchemaChangeFactory
has been renamed to ISchemaCommandFactory
and, instead of creating change objects, which are then applied directly, returns ISchemaCommand
objects, which can be either executed or transformed in some other way. IMigrateToolkit.GetActionFor()
has also been replace with CreateCommands()
, which mirrors the rest of the API by returning a sequence of commands to address a given ISchemaDifference
. This release still has some commands that cannot be transformed to pure SQL, but the goal is to be able to generate pure SQL for a schema migration. (QNO-993, QNO-4579, QNO-4581, 4588, 4591, QNO-4594)IMigrateSchemaAspect.Apply()
has been removed. All aspects will have to be updated to implement GetCommands()
instead, or to use one of the available base classes, like UpdateDataAspectBase
or ConvertPropertyTypeSchemaAspect
. The following example shows how to use the UpdateDataAspectBase
to customize migration for a renamed property.
internal class ArchivedMigrationAspect : UpdateDataAspectBase
{
public ArchivedMigrationAspect()
: base("ArchivedMigrationAspect", DifferenceType.RenamedProperty, ChangePhase.Instead)
{
}
protected override void UpdateData(IMigrateContext context, ISchemaDifference difference)
{
using (var session = context.CreateSession(difference))
{
session.ChangeAndSaveAll<Project>(UpdateArchivedFlag);
}
}
private void UpdateArchivedFlag(Project obj)
{
obj.Archived = !obj.Archived;
}
}
The base aspects should cover most needs; if your functionality is completely customized, you can easily pass your previous implementation of Apply()
to a DelegateSchemaCommand
and return that from your implementation of GetCommands()
. See the implementation of UpdateDataAspectBase
for more examples. (QNO-4580)
MetaObjectIdEqualityComparer<T>
can no longer be constructed directly. Instead, use MetaObjectIdEqualityComparer<Project>.Default
.MetaClipboardControlDx.UpdateColorSkinaware()
to MetaClipboardControlDx.UpdateSkinAwareColors()
.IMetaUnique.LogicalParent
has been moved to IMetaBase
. Since IMetaUnique
inherits from IMetaBase
, it is unlikely that code is affected (unless reflection or some other direct means was used to reference the property). (QNO-4586)IUntypedMessage
has been removed; the AssociatedObject
formerly found there has been moved to IMessage
.ITypedMessage.AssociatedObject
has been renamed to ITypedMessage.TypedAssociatedObject
. (QNO-4647)MetaObjectTools
to MetaReadableTools
.GenericObject.GetAsGuid()
and GenericObject.GetAsGuidDefault
as extension methods in MetaWritableTools
.IMetaFeedback.CreateGlobalContext()
has been removed. Instead the IGlobalContext
is created using the service locator.