public void EmploymentBasis_ValidInputs_Deserialises(string input, EmploymentBasis expected) { JsonDoc.Assert <TaxDeclaration, EmploymentBasis>( input: new JsonDoc.String(nameof(TaxDeclaration.EmploymentBasis), input), toProperty: (t) => t.EmploymentBasis, shouldBe: expected ); }
protected override OpResult _Store(EmploymentBasis _obj) { if (_obj == null) { return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "EmploymentBasis object cannot be created as it is null")); } if (Exists(_obj)) { ExecuteNonQuery(GetQuery_UpdateQuery(_obj)); return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Updated, _obj)); } ExecuteNonQuery(GetQuery_InsertQuery(_obj)); _obj.FromDb = true; return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj)); }
private DbUpdateStatement GetQuery_UpdateQuery(EmploymentBasis _obj) { return(DbMgr.CreateUpdateClause("EmploymentBasis", GetFields(_obj), "EmploymentBasisID", _obj.EmploymentBasisID)); }
private DbInsertStatement GetQuery_InsertQuery(EmploymentBasis _obj) { Dictionary <string, DbFieldEntry> fields = GetFields(_obj); return(DbMgr.CreateInsertClause("EmploymentBasis", fields)); }