/// <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; }
/// <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); }
/// <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; }