public void AddUserToChat(TitanWcfService.DataAccesLayer.Entities.User user, TitanWcfService.DataAccesLayer.Entities.Chat chat)
 {
     TitanWcfService.DataAccesLayer.Entities.Room room = new TitanWcfService.DataAccesLayer.Entities.Room();
     room.UserId = user.Id;
     room.ChatId = chat.Id;
     context.Rooms.Add(room);
 }
        public void RemoveUserFromChat(TitanWcfService.DataAccesLayer.Entities.User user, TitanWcfService.DataAccesLayer.Entities.Chat chat)
        {
            List <TitanWcfService.DataAccesLayer.Entities.User> usersOfChat = GetUsersOfChat(chat);

            if (usersOfChat.Count == 1)
            {
                RemoveChat(chat);
            }
            else
            {
                TitanWcfService.DataAccesLayer.Entities.Room room = context.Rooms.FirstOrDefault(g => g.UserId == user.Id && g.ChatId == chat.Id);
                context.Rooms.Remove(room);
            }
        }