Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public override async Task OnConnectedAsync()
        {
            await Clients.All.SendAsync("UserConnected", _connectedUserAccessor.GetId());

            await base.OnConnectedAsync();
        }