public UnitOfWork(DataContext context) { _context = context; Users = new UserRepository(_context); Roles = new RoleRepo(_context); Products = new ProductRepo(_context); Suppliers = new SupplierRepo(_context); PosTransaction = new PosTransactionRepo(_context); PosTransactionProducts = new PosTransactionProductRepo(_context); ChatMessages = new ChatMessageRepo(_context); ProductLogs = new ProductLogRepo(_context); Members = new MemberRepo(_context); }
public void SendChat(string username, string message) { string error; var chtMsgRepo = new ChatMessageRepo(); try { chtMsgRepo.SaveChatMessage(new ChatMessage() { UserName = username, Message = message, }, out error); } catch (Exception ex) { error = ex.Message; } }