Exemple #1
0
        protected override void OnProcessDelta(Delta d)
        {
            base.OnProcessDelta(d);
            if (d.HasFlag(Delta.Stats))
            {
                StatsChanged.Raise(this);
            }

            if (d.HasFlag(Delta.Skills))
            {
                SkillsChanged.Raise(this);
            }
        }
Exemple #2
0
        public async Task <IActionResult> Post([FromBody] DtoSkill dto)
        {
            var result = Mapper.Map <Skill>(dto);

            _context.Skills.Add(result);
            await _context.SaveChangesAsync();

            dto.Id = result.Id;
            var @event = new SkillsChanged
            {
                Created = new List <DtoSkill> {
                    dto
                }
            };

            _eventBus.Publish(@event);

            return(Ok(result.Id));
        }
Exemple #3
0
 void InvokeOnSkillsChanged()
 {
     SkillsChanged.SafeInvoke(this, new SkillsChangedEventArgs(TakeChangedSkills()));
 }