Exemple #1
0
        public TrackedDayRecordViewModel()
        {
            DrinkTypes = Mapper.Map <ObservableCollection <DrinkTypeViewModel> >(DrinkTypesService.GetAll());
            DrinkType  = DrinkTypes.FirstOrDefault();

            Time = DateTime.Now.TimeOfDay;

            Volume = _step;

            DecreasePortionCommand = new Command(DecreasePortion);
            IncreasePortionCommand = new Command(IncreasePortion);
        }
Exemple #2
0
 public IHttpActionResult Get()
 {
     try
     {
         var res = DrinkTypesService.Get().Select(d => new { d.Id, d.Description, d.AlcoholContent });
         return(Ok(res));
     }
     catch (Exception e)
     {
         return(NotFound());
     }
 }