Exemplo n.º 1
0
 public RequestedLink(Guid processId, OpenedLibrary requestingLibrary, OpenedLibrary targetLibrary)
 {
     ProcessId = processId;
     RequestingLibraryId = requestingLibrary.Id;
     RequestingLibraryName = requestingLibrary.Name;
     RequestingAdministratorId = requestingLibrary.AdministratorId;
     RequestingAdministratorPicture = requestingLibrary.AdministratorPicture;
     TargetLibraryId = targetLibrary.Id;
     TargetLibraryName = targetLibrary.Name;
     TargetAdministratorId = targetLibrary.AdministratorId;
     TargetAdministratorPicture = targetLibrary.AdministratorPicture;
 }
Exemplo n.º 2
0
 public LibraryLink(Guid processId, OpenedLibrary requestingLibrary, OpenedLibrary acceptingLibrary)
 {
     ProcessId = processId;
     RequestingLibraryId = requestingLibrary.Id;
     RequestingLibraryName = requestingLibrary.Name;
     RequestingAdministratorId = requestingLibrary.AdministratorId;
     RequestingAdministratorPicture = requestingLibrary.AdministratorPicture;
     AcceptingLibraryId = acceptingLibrary.Id;
     AcceptingLibraryName = acceptingLibrary.Name;
     AcceptingAdministratorId = acceptingLibrary.AdministratorId;
     AcceptingAdministratorPicture = acceptingLibrary.AdministratorPicture;
 }
Exemplo n.º 3
0
 public LibraryBook(Guid processId, OpenedLibrary library, string title, string author, string isbn, int publishYear)
 {
     ProcessId = processId;
     LibraryId = library.Id;
     LibraryName = library.Name;
     LibraryAdminId = library.AdministratorId;
     AdministratorPicture = library.AdministratorPicture;
     Title = title;
     Author = author;
     Isbn = isbn;
     PublishYear = publishYear;
 }
        public override void When(Domain.OpenLibrary.LibraryOpened @event)
        {
            AuthenticatedUser user            = Session.Get <AuthenticatedUser>(@event.AdministratorId);
            OpenedLibrary     existingLibrary = Session.Get <OpenedLibrary>(@event.AggregateId);

            if (existingLibrary != null)
            {
                return;
            }

            OpenedLibrary openedLibrary = new OpenedLibrary(@event.AggregateId, @event.Name, user.Id, user.Picture);

            Session.Save(openedLibrary);
        }