How to add another unit?


Please see below.

How to add a new unit generated?

Example:

uses
  SysUtils,
  Generics.Collections,
  Aurelius.Mapping.Attributes,
  Aurelius.Types.Blob,
  Aurelius.Types.DynamicProperties,
  Aurelius.Types.Nullable,
  Aurelius.Types.Proxy,
  Aurelius.Criteria.Dictionary,
  MyUnit; // custom attributes


How to add?

procedure OnUnitGenerated(Args: TUnitGeneratedArgs);
var
  s: TCodeUsedUnit;
begin              
  s :=
  Args.CodeUnit.InterfaceUnits.Add // ??
  Args.Field.AddAttribute(Args.DBField.Description);
end;

1. Intellisense not working for TCodeUsedUnit. How would I use this?

2. Intellisense for Args.Create how to use ?

3. How to add uses (something) to the generated uses list?



Guessing what parameter 1 is...

procedure OnUnitGenerated(Args: TUnitGeneratedArgs);
var
  s, t: TCodeUsedUnit;            
begin                                                
  s := TCodeUsedUnit.Create('Unit2');        
  Args.CodeUnit.InterfaceUnits.Add(s);

  t := TCodeUsedUnit.Create('Unit1');        
  Args.CodeUnit.InterfaceUnits.Add(t);         
end;



Have you checked this topic in documentation?


http://www.tmssoftware.biz/business/dmodeler/doc/web/adding-a-unit-name-to-the-uses.html