public async Task <bool> AddModule(AddModuleCmd cmd)
        {
            var evt        = ModuleAddedEvt.MakeEventEntity(cmd);
            var insertions = await eventRepository.Create(evt);

            return(insertions > 0);
        }
Beispiel #2
0
 public static EventEntity MakeEventEntity(AddModuleCmd cmd)
 {
     return(new EventEntity {
         UserId = cmd.Id,
         Body = new ModuleAddedEvt(cmd)
     });
 }
        public async Task <IActionResult> AddModule(long id, long moduleId)
        {
            var addModCmd = new AddModuleCmd(id, moduleId, HttpContext.UserId().Value);
            var added     = await companyRepo.AddModule(addModCmd);

            if (added)
            {
                return(NoContent());
            }
            else
            {
                return(BadRequest());
            }
        }
Beispiel #4
0
 public ModuleAddedEvt(AddModuleCmd cmd)
 {
     Id       = cmd.Id;
     ModuleId = cmd.ModuleId;
 }