Converting Several Services to CodeFirst

Hi

Is there an option to convert multiple services to CodeFirst by command line?

I have several services and to convert by Delphi IDE it is necessary to open each project. I currently have approximately 400 service projects.

Regards,

Smokoveck

Hi,

we haven’t such command line tool, but you can easily write it for yourself.

look at uROCodeFirstConversionWizard.pas and his TROCodeFirstConversionWizard class.
you should call ConvertExistingImplFile method.

note: it will convert only service methods declarations and won’t convert methods bodies.

if you are using events, you should convert it manually like

RODL-based:

procedure TChatServerService.Talk(const Message: Unicodestring);
var
  ev: IChatEvents_Writer;
begin
  ev := (EventRepository as IChatEvents_Writer);
  ev.ExcludeSender := False;
  ev.Message(session.SessionID, VarToStr(Session['nick']), '', Message);
end;

Code-First based:

procedure TChatServerService.Talk(const Message: Unicodestring);
var
  ev: IROEventWriter<IChatEvents>;
begin
  ev := (EventRepository.GetWriter<IChatEvents>(session.SessionID));
  ev.ExcludeSender := False;
  ev.Event.Message(VarToStr(Session['nick']), '', Message);
end;