Skip to content

Instantly share code, notes, and snippets.

@vmandic
Created October 13, 2018 18:38
Show Gist options
  • Save vmandic/f0892f7c60c66b03a2a8dfda8bd35d5c to your computer and use it in GitHub Desktop.
Save vmandic/f0892f7c60c66b03a2a8dfda8bd35d5c to your computer and use it in GitHub Desktop.
meds-processor, part 1 of 4, snippet 8
using System;
using System.Linq;
namespace MedsProcessor.Common.Models
{
public class HzzoMedsDownloadDto
{
private readonly string _rootLocation;
public HzzoMedsDownloadDto(string href, string validFrom, string rootLocation)
{
this.Href = href;
this.ValidFrom = DateTime.Parse(validFrom);
this._rootLocation = rootLocation;
}
public string FileName =>
ValidFrom.ToString("yyyy-MM-dd_") +
(Href.Split('/').LastOrDefault() ?? Href.Replace("/", "_").Replace(":", "_")).TrimEnd();
public string Href { get; internal set; }
public DateTime ValidFrom { get; private set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment