Exemplo n.º 1
0
        public ITrustedDevice RegisterTrustedDevice(ILogin login, DeviceType type, DeviceTrustLevel trustLevel)
        {
            var session     = EntityHelper.GetSession(login);
            var deviceToken = RandomHelper.GenerateRandomString(10);
            var device      = login.NewTrustedDevice(deviceToken, type, trustLevel);

            session.SaveChanges();
            return(device);
        }
Exemplo n.º 2
0
 public ITrustedDevice RegisterTrustedDevice(ILogin login, DeviceType type, DeviceTrustLevel trustLevel)
 {
     var session = EntityHelper.GetSession(login);
       var deviceToken = RandomHelper.GenerateRandomString(10);
       var device = login.NewTrustedDevice(deviceToken, type, trustLevel);
       session.SaveChanges();
       return device;
 }
Exemplo n.º 3
0
 public static ITrustedDevice NewTrustedDevice(this ILogin login, string token, DeviceType type, DeviceTrustLevel trustLevel)
 {
     var session = EntityHelper.GetSession(login);
       var ent = session.NewEntity<ITrustedDevice>();
       ent.Login = login;
       ent.Token = token;
       ent.TrustLevel = trustLevel;
       ent.Type = type;
       ent.LastLoggedIn = session.Context.App.TimeService.UtcNow;
       return ent;
 }
Exemplo n.º 4
0
        public static ITrustedDevice NewTrustedDevice(this ILogin login, string token, DeviceType type, DeviceTrustLevel trustLevel)
        {
            var session = EntityHelper.GetSession(login);
            var ent     = session.NewEntity <ITrustedDevice>();

            ent.Login        = login;
            ent.Token        = token;
            ent.TrustLevel   = trustLevel;
            ent.Type         = type;
            ent.LastLoggedIn = session.Context.App.TimeService.UtcNow;
            return(ent);
        }