private IActionResult GetActivePropertyImage(int id, int img = 0, int size = 0) { StringBuilder baseUrl = new StringBuilder(_optionsAccessor.CurrentValue.Option3); if (size == 0) { baseUrl.Append(_optionsAccessor.CurrentValue.Option4); } else if (size == 1) { baseUrl.Append(_optionsAccessor.CurrentValue.Option5); } else if (size == 2) { baseUrl.Append(_optionsAccessor.CurrentValue.Option6); } baseUrl.Append(id); baseUrl.Append(":"); baseUrl.Append(img); NtreisRETsOptions ntreisOptions = new NtreisRETsOptions(); ntreisOptions.BaseUrl = baseUrl.ToString(); NtreisRETS ntreisRETS = new NtreisRETS(_optionsAccessor.CurrentValue.Option1, _optionsAccessor.CurrentValue.Option2); return(File(ntreisRETS.GetImage(ntreisOptions).GetAwaiter().GetResult(), "image/jpeg")); }
private PagedResult <ResidentialProperty> GetNtreisProps(bool active, int page) { NtreisRETsOptions ntreisOptions = new NtreisRETsOptions(); ntreisOptions.BaseUrl = _optionsAccessor.CurrentValue.Option3; ntreisOptions.QueryActive = active; ntreisOptions.Offset = page; NtreisRETS ntreisRETS = new NtreisRETS(_optionsAccessor.CurrentValue.Option1, _optionsAccessor.CurrentValue.Option2); return(ntreisRETS.Search(ntreisOptions).GetAwaiter().GetResult()); }
public IActionResult GetActiveByMlsID(int id) { //return GetProps(true); bool active = true; NtreisRETsOptions ntreisOptions = new NtreisRETsOptions(); ntreisOptions.BaseUrl = _optionsAccessor.CurrentValue.Option3; ntreisOptions.QueryActive = active; ntreisOptions.QueryMlsId = id; NtreisRETS ntreisRETS = new NtreisRETS(_optionsAccessor.CurrentValue.Option1, _optionsAccessor.CurrentValue.Option2); return(Ok(new { Data = ntreisRETS.Search(ntreisOptions).GetAwaiter().GetResult() })); }