public Domain.Entities.CourseConfiguration Add(Domain.Entities.CourseConfiguration entity) { if (!entity.IsValid()) { return(entity); } if (entity.IsCurrentConfiguration) { try { DisableCurrentConfiguration(entity); } catch (Exception ex) { entity.AddError(ex.Message); return(entity); } } return(_courseConfigurationRepository.Add(entity)); }