コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public Guid Add(HallModel model)
        {
            Hall   hall   = Mapper.Map <Hall>(model);
            string errors = Validate(hall);

            if (errors != null)
            {
                throw new ValidationException(errors);
            }

            _hallRepository.Insert(hall);
            return(hall.Id);
        }
コード例 #2
0
ファイル: HallService.cs プロジェクト: jaca1119/CinemaApi
 public bool CreateHall(Hall hall)
 {
     hallRepository.Insert(hall);
     return(hallRepository.SaveChanges() > 0);
 }