/// <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); }
public void Insert(T t) { if (t != null) { _context.Add(t); } }
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); }
protected virtual void AddEntity(IEnumerable <TEntity> entities) { context.Add(entities); }