Hej,
jak pobierać dane wg wielu ( kilkunastu ) warunków o które woła klient, Chodzi mi o coś takiego, że mamy formularz z polami wg których chcemy pobrać dane jak ponizej. Jak konstruować warunki? Jak to zrobić z EF Core 7
załóżmy taką encję
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string? Street { get; set; }
public string? ZipCode { get; set; }
public string? Locality { get; set; }
public Gender? Gender { get; set; }
public string? Nationality { get; set; }
}
i teraz przychodzi przykładowy request
public string? LastName { get; set; }
public string? Phone { get; set; }
public string? Email { get; set; }
public string? Street { get; set; }
public string? ZipCode { get; set; }
public string? Locality { get; set; }
public Gender? Gender { get; set; }
// z frontu {
Phone: "345"; // phone like "%345%"
Locality: "Paris"; // locality like "%paris%"
Gender: "Male; // gender == "Male"
}
wiadomo innym razem może przyjść inny zestaw