public ICommandResult Handler(CreateUserListaCommand command) { command.Validate(); if (command.Invalid) { return(new GenericCommandResult(false, "sem sucesso", command.Notifications)); } var lista = _listaRepository.GetById(command.IdLista); var user = _userRepository.GetById(command.IdUser); var userList = new UserListaEntity( command.Register, command.IdUser, command.IdLista); //userList.ListaId = lista.Id; //userList.UserId = user.Id; //userList.Register = command.Register; //userList.Lista = lista; //userList.User = user; _userListaRepository.CreateUserList(userList); return(new GenericCommandResult(true, "Sucesso", userList)); }
public ListaEntity GetAllById([FromServices] IListaRepository repository, Guid id) { //var user = repository.GetByIdFacebook(idFacebook); var result = repository.GetById(id); return(result); }
public ICommandResult Handler(GetByIdCommand command) { command.Validate(); if (command.Invalid) { return(new GenericCommandResult(false, "Sem sucesso", command.Notifications)); } var item = _listaRepository.GetById(command.Id); return(new GenericCommandResult(true, "sucesso", item)); }
public ICommandResult Handler(DeleteListaCommand command) { command.Validate(); if (command.Invalid) { return(new GenericCommandResult(false, "Alguma coisa deu errado", command.Notifications)); } var lista = _listaRepository.GetById(command.IdList); _listaRepository.DeleteLista(lista); return(new GenericCommandResult(true, "sucesso", "")); }
Pe05_Lista ObtenerListaId(long id) => _listaRepository.GetById <Pe05_Lista>(id);
public async Task <Lista> Consulta(int id) { return(await _listaRepository.GetById(id)); }