예제 #1
0
        public MatchDto Create()
        {
            Match match = new Match();

            match.Periods.Add(new Period());
            context.Match.Add(match);
            context.SaveChanges();
            return(mapper.Map <Match, MatchDto>(match));
        }
예제 #2
0
 public void Add(T entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(string.Format(_errorHandler.GetMessage(ErrorMessagesEnum.EntityNull), "", "Input data is null"));
     }
     try
     {
         _dbSet.Add(entity);
         _dbContext.SaveChanges();
     }
     catch
     {
         throw;
     }
 }