Пример #1
0
        public ActionResult Create(string placeId, string beerId, string comment)
        {
            if (placeId == "" || beerId == "" || comment == "")
            {
                return(Content("FAIL"));
            }

            var place = PlaceRepository.Get(placeId);
            var beer  = BeerRepository.Get(beerId);

            var tap = new Tap
            {
                Beer      = beer,
                Place     = place,
                Username  = SessionUser.Current.Username,
                Timestamp = DateTime.Now,
                Comment   = comment
            };

            TapRepository.Create(tap);
            return(Content("OK"));
        }