Adding
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
using System.Threading.Tasks;
|
||||
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels;
|
||||
using LCU.Library.Internal.CoreApiWrapperLib.Utilities;
|
||||
using LCU.Library.Internal.CoreApiWrapperLib.Configuration;
|
||||
using LCU.Library.Internal.CoreApiWrapperLib.CoreApiUtilities;
|
||||
using LCU.Library.Internal.CoreApiWrapperModel.Constants;
|
||||
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Properties;
|
||||
|
||||
namespace LCU.Library.Internal.CoreApiWrapperLib.DataAccess
|
||||
{
|
||||
public class PropertyDao : BaseCoreDao, IPropertyDao
|
||||
{
|
||||
private readonly CoreConfiguration _coreConfiguration;
|
||||
private readonly CoreApiConfiguration _coreApiConfiguration;
|
||||
|
||||
public PropertyDao(ICoreRequest coreRequest,
|
||||
CoreConfiguration coreConfiguration)
|
||||
: base(coreRequest)
|
||||
{
|
||||
_coreConfiguration = coreConfiguration;
|
||||
_coreApiConfiguration = _coreConfiguration.CoreApiConfiguration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Core API to get all property by propertynumber.
|
||||
/// Default Included: Graph, Standard
|
||||
/// </summary>
|
||||
/// <returns>Property</returns>
|
||||
public async Task<Property> FindProperty(long propertynumber)
|
||||
{
|
||||
var endpoint = HttpUtilities.ReplaceRootParameter(_coreApiConfiguration.CoreEndPointConfiguration.PropertyById,
|
||||
RequestRootParameters.PropertyNumber,
|
||||
propertynumber.ToString());
|
||||
var result = await _coreRequest.GetRequestObject<CoreApiMessage<Property>>(endpoint, null);
|
||||
return result?.MessageBody;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user