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); }
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); }
/// <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); }
public void SetPrimarySkill(PrimarySkill skill) { m_PrimarySkill = skill; }