コード例 #1
0
        public async Task <StatusGetResponse> GetAsync()
        {
            var latestMigration = await _statusRepository.GetLatestMigrationAsync();

            var result = new StatusGetResponse
            {
                ApiVersion          = GetType().GetTypeInfo().Assembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion,
                LatestMigrationDate = DateTime.ParseExact(latestMigration?.Substring(0, 14) ?? DateTime.MinValue.ToString("yyyyMMddHHmmss"), "yyyyMMddHHmmss", CultureInfo.InvariantCulture),
                LatestMigrationNote = latestMigration?.Substring(15)?.Replace('_', ' ') ?? string.Empty,
                TargetFramework     = Assembly.GetEntryAssembly()?.GetCustomAttribute <TargetFrameworkAttribute>()?.FrameworkName
            };

            return(result);
        }
コード例 #2
0
 public override void When()
 {
     base.When();
     response = GetAsync("status").Result;
     model    = GetModel <StatusGetResponse>(response);
 }