public void SaveConfirmationRequest(ConfirmationRequest request)
        {
            Require.NotNull(request, nameof(request));

            var session = _sessionProvider.GetCurrentSession();

            session.Save(request);
        }
Example #2
0
        public int CreateAccount(Account account)
        {
            Require.NotNull(account, nameof(account));

            var session        = _sessionProvider.GetCurrentSession();
            var savedAccountId = (int)session.Save(account);

            return(savedAccountId);
        }
        public int CreateOrganization(Organization organization)
        {
            Require.NotNull(organization, nameof(organization));

            var session    = _sessionProvider.GetCurrentSession();
            var savedOrgId = (int)session.Save(organization);

            return(savedOrgId);
        }
Example #4
0
        public int CreateArtist(Artist artist)
        {
            Require.NotNull(artist, nameof(artist));

            var session       = _sessionProvider.GetCurrentSession();
            var savedArtistId = (int)session.Save(artist);

            return(savedArtistId);
        }
Example #5
0
        public Tag CreateTag(string tag)
        {
            Require.NotNull(tag, nameof(tag));

            var session    = _sessionProvider.GetCurrentSession();
            var newTag     = new Tag(tag.ToLower());
            var savedTagId = (int)session.Save(newTag);

            return(session.Get <Tag>(savedTagId));
        }
Example #6
0
        public IEnumerable <TEntity> GetAll()
        {
            var session = _sessionProvider.GetCurrentSession();
            IEnumerable <TEntity> results;

            using (var tx = session.BeginTransaction())
            {
                results = session.QueryOver <TEntity>()
                          .List <TEntity>();
                tx.Commit();
            }
            return(results);
        }
Example #7
0
 public UnitOfWork(ISessionProvider sessionProvider)
 {
     _sessionProvider = sessionProvider;
     Session          = _sessionProvider.GetCurrentSession();
 }
Example #8
0
        public int CreateProject(Project project)
        {
            Require.NotNull(project, nameof(project));

            var session        = _sessionProvider.GetCurrentSession();
            var savedProjectId = (int)session.Save(project);

            return(savedProjectId);
        }
Example #9
0
        public ITransaction BeginTransaction()
        {
            var session = _sessionProvider.GetCurrentSession();

            return(session.BeginTransaction());
        }