public int Update(EducationTypeModel model) { string sqlUpdate = "UPDATE EducationType SET Name = @Name WHERE Id = @Id"; using (_connection) { return(_connection.Execute(sqlUpdate, model)); } }
public int Insert(EducationTypeModel model) { string sqlInsert = "INSERT INTO EducationType (Id, Name) Values (@Id, @Name)"; using (_connection) { return(_connection.Execute(sqlInsert, model)); } }
public int Delete(EducationTypeModel model) { string sqlDelete = "DELETE FROM EducationType WHERE Id = @Id"; using (_connection) { return(_connection.Execute(sqlDelete, model)); } }
/// <summary> /// Method whose purpose is to insert a new /// EducationType record. /// </summary> /// <param name="educationType"> /// Newly created EducationTypeModel object. /// </param> /// <returns> /// Returns true if the query is successfully executed /// otherwise returns false. /// </returns> public bool Insert(EducationTypeModel educationType) { return(_educationTypeRepository.Insert(educationType) > 0 ? true : false); }
/// <summary> /// Method whose purpose is to delete existing object /// from the database /// </summary> /// <param name="educationType"> /// Existing education type model object. /// </param> /// <returns> /// Returns true if the query is successfully executed /// otherwise returns false. /// </returns> public bool Delete(EducationTypeModel educationType) { return(_educationTypeRepository.Delete(educationType) > 0 ? true : false); }