Hi,AbdullahDurrani-7930,
GetRestaurantsByName
gets restaurants with name
.Firstly you need to check if name is empty or null with string.IsNullOrEmpty(name)
,if it is null or empty,you only need to return all restaurants.If it is not null or empty,you need to get restaurants with name
.So there is a ||
between string.IsNullOrEmpty(name)
and r.Name.StartsWith(name)
.Only when name is not null or empty,it will check r.Name
with r.Name.StartsWith(name)
.
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
YiyiYou