public MessageFormViewModel(int id, Message mess) { userRep = new UserRepository(); messageRep = new MessageRepository(); channelRep = new ChannelRepository(); chat = channelRep.showChatroom(id); user = userRep.getOwner(channelRep.showChatroom(id)); messes = messageRep.showChatroomMessages(id).ToList(); }
private MessageFormViewModel view; //Meldingenes ViewModel #endregion Fields #region Constructors /// <summary> /// Konstruktør som oppretter de forskjellige repositoriene slik at /// kontrolleren kan benytte seg av disse /// </summary> public AdminController() { messageRep = new MessageRepository(); userRep = new UserRepository(); channelRep = new ChannelRepository(); try { config = new AdminRepository(User.Identity.Name); } catch (NullReferenceException e) { } }
private MessageFormViewModel view; //Meldingenes ViewModel #endregion Fields #region Constructors /// <summary> /// Konstruktør /// </summary> public ChannelController() { channelRep = new ChannelRepository(); messRep = new MessageRepository(); userRep = new UserRepository(); }
/// <summary> /// Konstruktør /// </summary> public UserController() { userRep = new UserRepository(); messageRep = new MessageRepository(); }
/// <summary> /// Kontruktør /// </summary> public MessageController() { messageRep = new MessageRepository(); userRep = new UserRepository(); }