public IEnumerable<dish> GetDishByUserId(string Id, int limit = 0)
{
IEnumerable<dish> result;
if (limit == 0)
{
result = context.dishes.Where(d => d.Id_User == Id);
}
else
{
result = context.dishes.Where(d => d.Id_User == Id).Take(limit);
}
var dishtypes = GetDishTypes();
foreach(var item in result)
{
item.dishtype = dishtypes.FirstOrDefault(dt => dt.Id_DishType == item.Id_Type);
}
return result;
}