예제 #1
0
        public async Task<ActionResult> Add(DormViewModel dormModel)
        {
            var dorm = new DomainClasses.Dorm()
            {
                Name = dormModel.Name
            };

            _dormService.Add(dorm);

            await _dbContext.SaveChangesAsync();

            return Json(dorm.Id);
        }
        public async Task <ActionResult> Add(DormViewModel dormModel)
        {
            var dorm = new DomainClasses.Dorm()
            {
                Name = dormModel.Name
            };

            _dormService.Add(dorm);

            await _dbContext.SaveChangesAsync();

            return(Json(dorm.Id));
        }
예제 #3
0
        public async Task<ActionResult> Edit(DormViewModel dormModel)
        {
            var dorm = new DomainClasses.Dorm()
            {
                Id = dormModel.Id,
                Name = dormModel.Name
            };

            _dormService.Edit(dorm);

            await _dbContext.SaveChangesAsync();

            return new HttpStatusCodeResult(HttpStatusCode.OK);
        }
        public async Task <ActionResult> Edit(DormViewModel dormModel)
        {
            var dorm = new DomainClasses.Dorm()
            {
                Id   = dormModel.Id,
                Name = dormModel.Name
            };

            _dormService.Edit(dorm);

            await _dbContext.SaveChangesAsync();

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }