public async Task <IActionResult> SendMessage( int roomId, string message, [FromServices] EmpStoreContext ctx) { var Message = new Message { ChatId = roomId, Text = message, Name = User.Identity.Name, Timestamp = DateTime.Now }; ctx.Messages.Add(Message); await ctx.SaveChangesAsync(); await room.Clients.Group(roomId.ToString()) .SendAsync("RecieveMessage", new { Text = Message.Text, Name = Message.Name, Timestamp = Message.Timestamp.ToString("dd/MM/yyy hh:mm:ss") }); return(Ok()); }
public Repo4(EmpStoreContext context, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IHttpContextAccessor httpContextAccessor) { _context = context; _userManager = userManager; _signInManager = signInManager; _httpContextAccessor = httpContextAccessor; }
public HomeController(ILogger <HomeController> logger, Repo repo, Repo2 repo2, Repo3 repo3, Repo4 repo4, EmpStoreContext ctx) { _logger = logger; _repo = repo; _repo2 = repo2; _repo3 = repo3; _repo4 = repo4; _ctx = ctx; }
public EmployeeHomeController(TaskRepo taskRepo, AttendenceRepo attendenceRepo, LeaveRepository leaveRepository, IEmpRepository empRepository, IWebHostEnvironment webHostEnvironment, TimeTrackRepo timeTrackRepo, EmpStoreContext context, Repo4 repo4) { _timeTrackRepo = timeTrackRepo; _empRepository = empRepository; _webHostEnvironment = webHostEnvironment; _context = context; _leaveRepository = leaveRepository; _attendenceRepository = attendenceRepo; _taskRepository = taskRepo; _repo4 = repo4; }
public CollectionRepository(EmpStoreContext context) { _context = context; }
public PostApiController(EmpStoreContext context) { _context = context; }
public Repo2(EmpStoreContext context, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager) { _context = context; _userManager = userManager; _signInManager = signInManager; }
public TimeTrackRepo(EmpStoreContext context) { _context = context; }
public RoomViewComponent(EmpStoreContext ctx) { _ctx = ctx; }
public CustomerRepository(EmpStoreContext context) { _context = context; }
public Repo3(EmpStoreContext context) { _context = context; }
public LeaveRepository(EmpStoreContext context) { _context = context; }
public BudgetRepository(EmpStoreContext context) { _context = context; }
public ProjectRepository(EmpStoreContext context) { _context = context; }
public AttendenceRepo(EmpStoreContext context) { _context = context; }
public DocumentRepository(EmpStoreContext context) { _context = context; }
public PreCollectionController(CollectionRepository collectionRepository, ProjectRepository projectRepository, EmpStoreContext context) { _collectionRepository = collectionRepository; _projectRepository = projectRepository; _context = context; }
public TaskRepository(EmpStoreContext context) { _context = context; }
public JobRepository(EmpStoreContext context) { _context = context; }