added mock update method
This commit is contained in:
parent
2405ae8d0e
commit
ec2aadfd6b
@ -32,6 +32,15 @@ namespace BinaryDad.AggregateDal
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Update attempt
|
||||||
|
|
||||||
|
newAttempt.ClientFirstName = "Rick";
|
||||||
|
newAttempt.ClientLastName = "Martini";
|
||||||
|
|
||||||
|
settlementAttemptDataAccess.UpdateAttempt(newAttempt);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Get attempt
|
#region Get attempt
|
||||||
|
|
||||||
var attempt = settlementAttemptDataAccess.GetAttempt(1234);
|
var attempt = settlementAttemptDataAccess.GetAttempt(1234);
|
||||||
|
@ -19,6 +19,15 @@ namespace BinaryDad.AggregateDal
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool UpdateAttempt(SettlementAttempt attempt)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Updating attempt ID {attempt.Id} to SQL");
|
||||||
|
|
||||||
|
// use EF to attach to context and SaveChanges()
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public SettlementAttempt GetAttempt(int recordId)
|
public SettlementAttempt GetAttempt(int recordId)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Getting attempt {recordId} from SQL");
|
Console.WriteLine($"Getting attempt {recordId} from SQL");
|
||||||
|
@ -11,6 +11,13 @@ namespace BinaryDad.AggregateDal
|
|||||||
/// <returns>Whether the add operation was successful</returns>
|
/// <returns>Whether the add operation was successful</returns>
|
||||||
bool AddAttempt(SettlementAttempt attempt);
|
bool AddAttempt(SettlementAttempt attempt);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an attempt
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="attempt">An existing attempt to update</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
bool UpdateAttempt(SettlementAttempt attempt);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves an existing settlement attempt
|
/// Retrieves an existing settlement attempt
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -21,5 +21,19 @@ namespace BinaryDad.AggregateDal
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool UpdateAttempt(SettlementAttempt attempt)
|
||||||
|
{
|
||||||
|
// update SQL first
|
||||||
|
base.UpdateAttempt(attempt);
|
||||||
|
|
||||||
|
// use mapping of the properties to build a request using QB API
|
||||||
|
// consider using reflection on the type, such as use of a [QuickBaseField(SettlementAttemptFieldMap.ClientFirstName)]
|
||||||
|
// to build list of mappings in QB API
|
||||||
|
|
||||||
|
Console.WriteLine($"Updating attempt ID {attempt.RecordId} to Quickbase with SQL ID {attempt.Id}");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user