public async Task <ActionResult <RolDTO> > Post([FromBody] RolCreateDTO rolCreate) { var rol = mapper.Map <Rol>(rolCreate); var rolDTO = mapper.Map <RolDTO>(await repository.Save(rol)); return(new CreatedAtRouteResult("ObtenerRolv1", new { id = rol.Id }, rolDTO)); }
public async Task Save(Rol rol, string menuler) { var rolid = await _rolRepository.Save(rol); foreach (var menuno in menuler.Split(",")) { await _rolMenuRepository.Save(new RolMenu { CreatorId = rol.CreatorId, FirmaId = rol.FirmaId, MenuNo = int.Parse(menuno), RolId = rolid }); } }
public bool Save(Rol entity) { return(rolRepository.Save(entity)); }
public ActionResult CrearRol(Rol model) { _rolRepository.Save(model); return(RedirectToAction("ListarRoles")); }
void Crear(Sg07_Rol Rol) { _RolRepository.Create <Sg07_Rol>(Rol); _RolRepository.Save(); }