internal void SaveAccesscode()
        {
            if (this.Session == null)
            {
                throw new InvalidOperationException("Requires an existing Main to save an Accesscode entity");
            }
            var accesscodeEntity = new Accesscode()
            {
                Session     = (Guid)this.Session,
                Phonenumber = _pnonenumber,
                Accesscode1 = _accesscode
            };

            _DbContext.Accesscode.Add(accesscodeEntity);
            _DbContext.SaveChanges();
        }
 public long Insert(Accesscode accesscode)
 {
     _DbContext.Accesscode.Add(accesscode);
     _DbContext.SaveChanges();
     return(accesscode.Accesscodeid);
 }