Пример #1
0
        public IHttpActionResult Post(MyParkCreate myPark)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = CreateMyParkService();

            if (!service.CreateMyPark(myPark))
            {
                return(InternalServerError());
            }

            return(Ok());
        }
Пример #2
0
        public bool CreateMyPark(MyParkCreate model)
        {
            var entity =
                new MyPark()
            {
                OwnerID       = _userID,
                ParkID        = model.ParkID,
                TrailID       = model.TrailID,
                MyTrailStatus = model.MyTrailStatus,
                TrailComment  = model.TrailComment
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.MyParks.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Пример #3
0
 public bool CreateMyPark(MyParkCreate model)
 {
     throw new NotImplementedException();
 }