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

            return(insertions > 0);
        }
Exemplo n.º 2
0
 public static EventEntity MakeEventEntity(AddModuleCmd cmd)
 {
     return(new EventEntity {
         UserId = cmd.Id,
         Body = new ModuleAddedEvt(cmd)
     });
 }
Exemplo n.º 3
0
        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());
            }
        }
Exemplo n.º 4
0
 public ModuleAddedEvt(AddModuleCmd cmd)
 {
     Id       = cmd.Id;
     ModuleId = cmd.ModuleId;
 }