예제 #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
 public bool CreateHall(Hall hall)
 {
     hallRepository.Insert(hall);
     return(hallRepository.SaveChanges() > 0);
 }