Ejemplo n.º 1
0
        public MenuModel GetEstablishment( string name )
        {
            var model = new MenuModel();

            var place = base.Database.establishments.Where( x => x.name == name ).FirstOrDefault();

            return GetEstablishment( place.id );
        }
Ejemplo n.º 2
0
        public MenuModel GetEstablishment( int establistmentId, int beerId = 0 )
        {
            var model = new MenuModel();

            model.Establishment = Database.establishments.Where( x => x.id == establistmentId && x.deleted == false ).FirstOrDefault();
            model.EstablishmentBrands = Database.establishment_brands.Where( x => x.establishment_id == establistmentId && x.deleted == false ).ToList();

            if( beerId > 0 ) {
                model.Brand = Database.brands.Where( x => x.id == beerId && x.deleted == false ).FirstOrDefault();
            } else {
                model.Brand = new brand();
            }

            return model;
        }