Это определение в файле EDMX:
Код: Выделить всё
Код: Выделить всё
[EdmFunction("ControlVisitas3Model.Store", "ObtieneEdad")]
public static int? ObtieneEdad(DateTime fechaNacimiento)
{
throw new NotSupportedException("Direct calls are not supported.");
}
Код: Выделить всё
personas = personas.Where(p => !p.PersonaFechaNacimiento.HasValue ? false : DataWare.Persona.ObtieneEdad(p.PersonaFechaNacimiento.Value) >= edadMinima && DataWare.Persona.ObtieneEdad(p.PersonaFechaNacimiento.Value)
Подробнее здесь: [url]https://stackoverflow.com/questions/49928303/call-sql-server-udf-in-linq-query[/url]
Мобильная версия