Example #1
0
 public IEnumerable <IInvitation> GetAll(ISettings settings)
 {
     using (ILifetimeScope scope = m_dependencyContainer.GetContainer().BeginLifetimeScope())
     {
         IInvitationDataFactory dataFactory = scope.Resolve <IInvitationDataFactory>();
         IInvitationDataSaver   dataSaver   = scope.Resolve <IInvitationDataSaver>();
         return(dataFactory.GetAll(new Settings(settings))
                .Select <InvitationData, IInvitation>(d => new Invitation(d, dataSaver, m_responseFactory)));
     }
 }
Example #2
0
 public IInvitation Get(ISettings settings, Guid id)
 {
     using (ILifetimeScope scope = m_dependencyContainer.GetContainer().BeginLifetimeScope())
     {
         IInvitationDataFactory dataFactory = scope.Resolve <IInvitationDataFactory>();
         InvitationData         data        = dataFactory.Get(new Settings(settings), id);
         if (data != null)
         {
             IInvitationDataSaver dataSaver = scope.Resolve <IInvitationDataSaver>();
             return(new Invitation(data, dataSaver, m_responseFactory));
         }
         else
         {
             return(null);
         }
     }
 }