Esempio n. 1
0
        /// <summary>
        /// Adds the session for user.
        /// </summary>
        /// <param name="context">The database context.</param>
        /// <param name="userId">The user identifier.</param>
        /// <param name="sessionToken">The session token.</param>
        public void AddSessionForUser(OpenAccessContext context, long userId, string sessionToken)
        {
            this.RemoveSessionsOfUser(context, userId);
            object session = this.NewSession(userId, sessionToken);

            context.Add(session);
        }
Esempio n. 2
0
 public void Insert(T t)
 {
     if (t != null)
     {
         _context.Add(t);
     }
 }
Esempio n. 3
0
        private Guid CreateNewOpenAccessRecord()
        {
            using (var context = new OpenAccessContext())
            {
                var product = new OpenAccessProduct()
                {
                    Id = Guid.NewGuid()
                };

                context.Add(product);
                context.SaveChanges();
                return(product.Id);
            }
        }
 /// <summary>
 /// Adds a session for a gien user
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="userId">The user identifier.</param>
 /// <param name="sessionToken">The session token.</param>
 public void AddSessionForUser(OpenAccessContext context, long userId, string sessionToken)
 {
     this.RemoveSessionsOfUser(context, userId);
     object session = NewSession(userId, sessionToken);
     context.Add(session);
 }
Esempio n. 5
0
 protected virtual void AddEntity(IEnumerable <TEntity> entities)
 {
     context.Add(entities);
 }