public DataModel.Response.InsertResponse Create(DataModel.Model.EducationModel education) { try { IEducationRepository educationRepository = RepositoryClassFactory.GetInstance().GetEducationRepository(); IList <Education> _educations = educationRepository.FindByMainCourseStudy(education.MainCourseStudy); if (_educations != null && _educations.Count > 0) { return(new InsertResponse { ErrorCode = (int)ErrorCode.Error, Message = string.Format(Resources.Resource.msg_insert_exists, "Education", education.MainCourseStudy) }); } var _education = MapperUtil.CreateMapper().Mapper.Map <EducationModel, Education>(education); object id = educationRepository.Insert(_education); return(new InsertResponse { InsertID = id.ToString(), ErrorCode = (int)ErrorCode.None, Message = Resources.Resource.msg_create_success }); } catch (Exception ex) { return(new InsertResponse { ErrorCode = (int)ErrorCode.Error, Message = ex.Message }); } }