Example #1
0
        public PrimarySkill ConvertToModel(PrimarySkillDTO dto)
        {
            PrimarySkill model = new PrimarySkill()
            {
                Name        = dto.Name,
                Description = dto.Description,
                Id          = dto.Id,
                IsActive    = dto.IsActive,
                DateCreated = dto.DateCreated,
                DateUpdated = dto.DateUpdated
            };

            return(model);
        }
Example #2
0
        public PrimarySkillDTO ConvertToDTO(PrimarySkill model)
        {
            PrimarySkillDTO dto = new PrimarySkillDTO()
            {
                IsActive    = model.IsActive,
                Description = model.Description,
                Id          = model.Id,
                Name        = model.Name,
                DateCreated = model.DateCreated,
                DateUpdated = model.DateUpdated ?? DateTime.Now
            };

            return(dto);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="newPrimarySkill"></param>
        /// <returns></returns>
        public PrimarySkillDTO AddPrimarySkill(PrimarySkillDTO newPrimarySkill)
        {
            var primarySkill = new PrimarySkill()
            {
                Name        = newPrimarySkill.Name,
                Description = newPrimarySkill.Description,
                DateCreated = DateTime.Now,
                DateUpdated = DateTime.Now,
            };

            try
            {
                _dbContext.PrimarySkill.Add(primarySkill);
                _dbContext.SaveChanges();
                newPrimarySkill.Id = primarySkill.Id;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newPrimarySkill);
        }
Example #4
0
 public void SetPrimarySkill(PrimarySkill skill)
 {
     m_PrimarySkill = skill;
 }