Ejemplo n.º 1
0
 /// <summary>
 /// Maps TournamentRequest model.
 /// </summary>
 /// <param name="to">Target of the mapping</param>
 /// <param name="from">Source of the mapping</param>
 public static void Map(TournamentRequestEntity to, TournamentRequest from)
 {
     to.Id      = from.Id;
     to.UserId  = from.UserId;
     to.TeamId  = from.TeamId;
     to.GroupId = from.GroupId;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes tournament request by its identifier.
        /// </summary>
        /// <param name="id">Identifier of the request.</param>
        public void Remove(int id)
        {
            var dalToRemove = new TournamentRequestEntity {
                Id = id
            };

            _dalRequest.Attach(dalToRemove);
            _dalRequest.Remove(dalToRemove);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds new tournament request.
        /// </summary>
        /// <param name="newEntity">Tournament request to add.</param>
        public void Add(TournamentRequest newEntity)
        {
            var newRequestEntity = new TournamentRequestEntity();

            DomainToDal.Map(newRequestEntity, newEntity);
            _dalRequest.Add(newRequestEntity);
            _unitOfWork.Commit();
            newEntity.Id = newRequestEntity.Id;
        }