public TEntity GetSingle(Func<TEntity, bool> predicate)
{
try
{
var teste = _context.Set<TEntity>().Single(predicate);
}
catch (Exception)
{
return null;
}
return _context.Set<TEntity>().Single(predicate);
}
Func<vw_UsuarioPerfilAtributo, bool> expressionPerfil = Perf => Perf.IdUsuario == memo.IdUsuario//And Perf.IdTipoPerfil(MaxValue) // And Perf.Name.lenght > 3;
Session.Add("Permissao",vw_usuarioPerfilAtributoRepository.GetSingle(expressionPerfil).IdTipoPerfil);
Simple problems of query, but in lambda I do not know good way to do “AND” + “MaxValue” + other “WHERE” all examples for only one WHERE.
In
Lambdayou can simple add any condition using&&(For And) and||For(OR)