Skip to content

Commit

Permalink
let TRest resolve its Services internal list
Browse files Browse the repository at this point in the history
- and also minor changes
  • Loading branch information
Arnaud Bouchez committed Nov 3, 2020
1 parent 91334fd commit 88d39eb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/core/mormot.core.interfaces.pas
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ TInterfaceMethod = record
// - Kind will specify the expected returned document layout
procedure ArgsValuesAsDocVariant(Kind: TInterfaceMethodParamsDocVariantKind;
out Dest: TDocVariantData; const Values: TVariantDynArray; Input: boolean;
Options: TDocVariantOptions = [dvoReturnNullForUnknownProperty,
dvoValueCopiedByReference]);
Options: TDocVariantOptions =
[dvoReturnNullForUnknownProperty, dvoValueCopiedByReference]);
/// normalize a TDocVariant containing the input or output arguments values
// - "normalization" will ensure sets and enums are seralized as text
// - if Input is TRUE, will handle const / var arguments
Expand Down Expand Up @@ -4707,7 +4707,8 @@ class procedure TInterfaceResolverInjected.RegisterGlobalDelete(aInterface: PRtt
end;
end;

function TInterfaceResolverInjected.TryResolve(aInterface: PRttiInfo; out Obj): boolean;
function TInterfaceResolverInjected.TryResolve(aInterface: PRttiInfo;
out Obj): boolean;
var
i: PtrInt;
new: TInterfacedObject;
Expand Down
2 changes: 1 addition & 1 deletion src/orm/mormot.orm.mongodb.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ function TRestStorageMongoDB.SearchField(const FieldName, FieldValue: RawUTF8;
// use {%:%} here since FieldValue is already JSON encoded
query := BSONVariant('{%:%}',
[fStoredClassMapping^.InternalToExternal(FieldName), FieldValue], []);
// retrieve the ID for this query
// retrieve the IDs for this query
if id.Init(fCollection.FindBSON(query, BSONVariant(['_id', 1]))) then
begin
n := 0;
Expand Down
2 changes: 2 additions & 0 deletions src/orm/mormot.orm.storage.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4687,6 +4687,8 @@ function ToText(t: TORMVirtualTableTransaction): PShortString;
end;

initialization
// set late-binding return of TOrmVirtualTableClass.ModuleName
GetVirtualTableModuleName := @_GetVirtualTableModuleName;

end.

2 changes: 1 addition & 1 deletion src/rest/mormot.rest.core.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ function TRest.TryResolve(aInterface: PRttiInfo; out Obj): boolean;
if aInterface = TypeInfo(IRestOrm) then
IRestOrm(Obj) := fOrm
else
result := false;
result := fServices.Resolve(aInterface, Obj);
end;

procedure TRest.SetLogClass(aClass: TSynLogClass);
Expand Down
2 changes: 1 addition & 1 deletion src/rest/mormot.rest.memserver.pas
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ destructor TRestOrmServerFullMemory.Destroy;

procedure TRestOrmServerFullMemory.DropDatabase;
var
t: integer;
t: PtrInt;
begin
for t := 0 to fStaticDataCount - 1 do
TRestStorageInMemory(fStaticData[t]).DropValues;
Expand Down

0 comments on commit 88d39eb

Please sign in to comment.