1
I have a database to create a menu, in this I have three tables:
1 - Types of menu
2 - Groups of the menu
3 - Menu options
This database will be updated and consulted by a WEB API that has already been developed in ASP.NET CORE, that is, it is already running. Now I am modeling an application and I would like to know if with Xamarin Forms it is possible to create a listview that displays the options grouped according to the information of each table and only displays the complete list when touching one of the menu types. For example:
MEALS (table 1 - menu types)
SELF (table 2 - menu groups)
SELF-SERVICE (table 3 - menu options)
DAILY DISHES (Table 2 - Menu groups)
SEGUNDA - VIRADO A PAULISTA (table 3 - menu options)
TUESDAY - STEAK/CHICKEN PARMIGIANA (table 3 - menu options)
FOURTH - FEIJOADA (table 3 - menu options)
THURSDAY - LASAGNA (table 3 - menu options)
FRIDAY - FISH WITH MASHED POTATOES (table 3 - menu options)
DRINKS (table 1 - menu types)
SOFT DRINKS (Table 2 - Menu groups)
SODA CAN (table 3 - menu options)
SOFT DRINK 1.5L (table 3 - menu options)
JUICES (table 2 - menu groups)
NATURAL JUICE (GLASS) (table 3 - menu options)
NATURAL JUICE (JUG) (table 3 - menu options)
Thanks for your help.
Classes I use in the API:
public class TipoCardapio
{
[Key]
public int TipoId { get; set; }
[MaxLength(30)]
public string Descricao { get; set; }
public virtual ICollection<GruposDoCardapio> GruposDoCardapios { get; set; }
public virtual ICollection<OpcoesDoCardapio> OpcoesDoCardapios { get; set; }
}
public class GruposDoCardapio
{
[Key]
public int GrupoId { get; set; }
[MaxLength(30)]
public string Descricao { get; set; }
public string Notas { get; set; }
public virtual TipoCardapio TipoCardapios { get; set; }
public virtual ICollection<OpcoesDoCardapio> OpcoesDoCardapios { get; set; }
}
public class OpcoesDoCardapio
{
public int Id { get; set; }
[MaxLength(11)]
public string DiaDaSemana { get; set; }
[MaxLength(35)]
public string Descricao { get; set; }
[Column(TypeName = "decimal(18,2)")]
public decimal Valor { get; set; }
public virtual TipoCardapio TipoCardapios { get; set; }
public virtual GruposDoCardapio GruposDoCardapios { get; set; }
}
Thank you for the reply @Briansouza ... I will take a look at the link material, analyze the code and find the best way to adapt my need.
– Ari Venuth
If anyone else is looking, I found this link interesting.
– Ari Venuth