public static ReservationClient Create(IReservationItem rsv, IClient client, IEnumerable <IResourceClient> resourceClients, IEnumerable <IReservationInviteeItem> invitees, bool inlab)
        {
            var userAuth   = Reservations.GetAuthLevel(resourceClients, client);
            var isReserver = rsv.ClientID == client.ClientID;
            var isInvited  = invitees.Any(x => x.InviteeID == client.ClientID);

            var result = new ReservationClient
            {
                ClientID      = client.ClientID,
                ReservationID = rsv.ReservationID,
                ResourceID    = rsv.ResourceID,
                IsReserver    = isReserver,
                IsInvited     = isInvited,
                InLab         = inlab,
                UserAuth      = userAuth
            };

            return(result);
        }
        public static ClientAuthLevel GetAuthLevel(this ICache c, int resourceId, IClient client)
        {
            var resourceClients = c.ResourceClients(resourceId);

            return(Reservations.GetAuthLevel(resourceClients, client));
        }