//public FacultyStatusProcessor(IFacultyStatusDao dao, IFacultyStatusParamConverter paramConverter, // IFacultyStatusResultConverter resultConverter) //{ // this.Dao = dao; // this.ParamConverter = paramConverter; // this.ResultConverter = resultConverter; //} public FacultyStatusResult Create(FacultyStatusParam param) { Model.FacultyStatus entity = ParamConverter.Convert(param, null); entity = Dao.Save(entity); return(ResultConverter.Convert(entity)); }
public void Update(long id, FacultyStatusParam param) { Model.FacultyStatus oldEntity = Dao.Find(id); if (oldEntity != null) { Dao.Delete(oldEntity); Dao.Update(ParamConverter.Convert(param, null)); } else { Console.WriteLine($"No entity with Id = {id} was found"); } }
public Model.FacultyStatus Convert(FacultyStatusParam param, Model.FacultyStatus oldEntity) { Model.FacultyStatus entity = null; if (oldEntity != null) { entity = oldEntity; } else { entity = new Model.FacultyStatus { Code = param.Code, Id = param.Id, Description = param.Description, Name = param.Name }; } return(entity); }