Esempio n. 1
0
        public async Task AddSticker(StickerWithGroup stickerModel)
        {
            if (stickerModel.Model.Content == null && stickerModel.Model.Url == null)
            {
                return;
            }

            string id      = Guid.NewGuid().ToString();
            var    sticker = new Model.Entities.Sticker
            {
                Id      = id,
                X       = stickerModel.Model.X,
                Y       = stickerModel.Model.Y,
                Width   = stickerModel.Model.Width,
                Height  = stickerModel.Model.Height,
                Color   = stickerModel.Model.Color,
                Content = stickerModel.Model.Content,
                Url     = stickerModel.Model.Url
            };

            _context.Add(sticker);
            _context.Commit();
            await Clients.Group(stickerModel.Group).SendAsync("AddStickerSuccess", _context.GetAll());
        }
Esempio n. 2
0
 public void CreateSticker(Sticker Sticker)
 {
     _stickerRepository.Add(Sticker);
     SaveSticker();
 }