public CalendarEventDto Create(CalendarEventDto dto) { CalendarEvent entity = new CalendarEvent() { AllDay = dto.AllDay, Start = dto.Start, End = dto.End, User = new User() { Id = _connectedUserAccessor.GetId() }, hexColor = dto.hexColor, Title = dto.Title, Type = new CalendarEventType() { Id = dto.Id } }; _uow.CalendarEvents.Add(entity); _uow.Commit(); dto = ToCalendarEventDto(entity); return(dto); }
public MessageDto Create(MessageDto dto) { Message entity = new Message() { Channel = new Channel() { Id = dto.ChannelId }, User = new User() { Id = _connectedUserAccessor.GetId() }, Content = dto.Content, Creation = DateTime.UtcNow.Date }; _uow.Messages.Add(entity); _uow.Commit(); dto = ToMessageDto(entity); return(dto); }
public override async Task OnConnectedAsync() { await Clients.All.SendAsync("UserConnected", _connectedUserAccessor.GetId()); await base.OnConnectedAsync(); }