public async Task Open_Ok()
            {
                string sessionid = "temp session";
                var    pipeline  = CreatePipeline(
                    (next, ctxt) =>
                {
                    Assert.Equal(SessionContract.InitSession.Action, ctxt.Action.Action);
                    Assert.Equal("test", ctxt.Parameters[0]);
                    ctxt.ActionResult     = "result";
                    ctxt.ServerConnection = ConnectionDescriptor;
                    return(next(ctxt));
                });

                SetupSessionHandler(sessionid);

                var proxy  = CreateProxy(pipeline);
                var result = await proxy.OpenSession("test");

                SessionMetadata session = pipeline.Find <SessionMiddleware>().GetSession(proxy);

                Assert.Equal(ConnectionDescriptor, session.ServerConnection);
                Assert.Equal(result, session.InitSessionResult);
                Assert.Equal(ProxyState.Open, ProxyState.Open);
                SessionHandler.Verify();
            }
 public void ToProtoBuf(Session session, out SessionMetadata output)
 {
     output = new SessionMetadata()
     {
         Name               = session.Name,
         Duration           = session.Duration,
         SessionStartMillis = session.Datetime.ToBinary()
     };
 }
 public void Deserialize(ref ReadOnlySpan <byte> buffer)
 {
     IsEnabled = BinSerialize.ReadBool(ref buffer);
     if (!IsEnabled)
     {
         return;
     }
     Session = new SessionMetadata();
     Session.Deserialize(ref buffer);
 }
 public CalendarEventModel(SessionMetadata sessionMetadata, string colour)
 {
     AllDay  = false;
     Start   = sessionMetadata.StartTime;
     End     = sessionMetadata.EndTime;
     Title   = $"{sessionMetadata.ClassCode}";
     Display = CalendarDisplayModes.Auto;
     Color   = colour;
     if (sessionMetadata.RoomId.HasValue && !string.IsNullOrWhiteSpace(sessionMetadata.RoomName))
     {
         ExtendedProps = new
         {
             Room    = sessionMetadata.RoomName,
             Teacher = sessionMetadata.TeacherName
         };
     }
 }
    public ExtractSql(EntityMetadata entityMetadata)
        : base(entityMetadata.PersistentClass, null, entityMetadata.SessionMetadata.SessionFactoryImplementor, entityMetadata.SessionMetadata.Mapping)
    {
        if (entityMetadata == null)
        {
            throw new ArgumentNullException("entityMetadata");
        }
        _sessionMetadata = entityMetadata.SessionMetadata;
        _entityMetadata  = entityMetadata;
        _entityPersister = _entityMetadata.EntityPersister;
        var hydrateSpan = _entityPersister.EntityMetamodel.PropertySpan;

        _propertyColumnUpdateable = new bool[hydrateSpan][];
        _propertyColumnInsertable = new bool[hydrateSpan][];
        var i = 0;

        foreach (var prop in _entityMetadata.PersistentClass.PropertyClosureIterator)
        {
            _propertyColumnInsertable[i] = prop.Value.ColumnInsertability;
            _propertyColumnUpdateable[i] = prop.Value.ColumnUpdateability;
            i++;
        }
    }
 public EntityMetadata(Type entityType, SessionMetadata sessionMetadata)
 {
     _sessionMetadata = sessionMetadata;
     _entityType      = entityType;
 }
 public AttendanceRegisterModel(SessionMetadata metadata)
 {
     Metadata = metadata;
     Students = new List <AttendanceRegisterStudentModel>();
     Codes    = new List <AttendanceCodeModel>();
 }