Exemple #1
0
 public void AddToDatabase(User entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     using (var session = _sessionProvider.CreateSession())
     {
         using (var transaction = session.BeginTransaction())
         {
             session.Save(entity);
             transaction.Commit();
         }
     }
 }
Exemple #2
0
 public virtual void Start()
 {
     if (_session == null)
     {
         _session = _sessionProvider.CreateSession();
     }
 }
    private EntityModel GetEntityModel(string name)
    {
        ISessionProvider sessionProvider = CreateSessionProvider();
        Session          session         = sessionProvider.CreateSession();
        SalesForceClient client          = new SalesForceClient(session);

        return(client.DescribeEntity(name));
    }
 public IEnumerable <Shop> GetAllShops()
 {
     using (var session = _sessionProvider.CreateSession())
     {
         return(session.QueryOver <Shop>().Where(s => s.IsDeleted == false).List());
     }
 }
Exemple #5
0
        public void DoLogin()
        {
            try
            {
                _sessionProvider.CreateSession(Username, Password);

                OnLoginSucceeded();
            }
            catch (AuthenticationFailedException e)
            {
                Console.WriteLine(e.Message);
            }
        }