Skip to content

Commit a294131

Browse files
committed
Removing 'Satate' from the project. Minors upgrades.
1 parent 830f0c2 commit a294131

13 files changed

+29
-24
lines changed

AzureDevopsTracker/Adapters/WorkItemAdapter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using AzureDevopsTracker.DTOs;
22
using AzureDevopsTracker.Entities;
3+
using AzureDevopsTracker.Extensions;
34
using AzureDevopsTracker.Interfaces;
5+
using System;
46
using System.Collections.Generic;
57
using System.Linq;
68

@@ -86,8 +88,8 @@ public TimeByStateDTO ToTimeByStateDTO(TimeByState workItemStatusTime)
8688
{
8789
CreatedAt = workItemStatusTime.CreatedAt,
8890
State = workItemStatusTime.State,
89-
//TotalTime = workItemStatusTime.TotalTimeText,
90-
//TotalWorkedTime = workItemStatusTime.TotalWorkedTimeText
91+
TotalTime = TimeSpan.FromSeconds(workItemStatusTime.TotalTime).ToTextTime(),
92+
TotalWorkedTime = TimeSpan.FromSeconds(workItemStatusTime.TotalWorkedTime).ToTextTime()
9193
};
9294
}
9395

AzureDevopsTracker/Configurations/Configuration.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ namespace AzureDevopsTracker.Configurations
1313
{
1414
public static class Configuration
1515
{
16-
public static IServiceCollection AddAzureDevopsStateTracker(this IServiceCollection services, DataBaseConfig configurations)
16+
public static IServiceCollection AddAzureDevopsTracker(this IServiceCollection services, DataBaseConfig configurations)
1717
{
18-
services.AddDbContext<AzureDevopsStateTrackerContext>(options =>
18+
services.AddDbContext<AzureDevopsTrackerContext>(options =>
1919
options.UseSqlServer(DataBaseConfig.ConnectionsString));
2020

21-
services.AddScoped<AzureDevopsStateTrackerContext>();
21+
services.AddScoped<AzureDevopsTrackerContext>();
2222
services.AddScoped<IWorkItemAdapter, WorkItemAdapter>();
2323
services.AddScoped<IWorkItemRepository, WorkItemRepository>();
24-
services.AddScoped<IAzureDevopsStateTrackerService, AzureDevopsStateTrackerService>();
24+
services.AddScoped<IAzureDevopsTrackerService, AzureDevopsTrackerService>();
2525

2626
return services;
2727
}
2828

29-
public static IApplicationBuilder UseAzureDevopsStateTracker(this IApplicationBuilder app, IServiceProvider serviceProvider)
29+
public static IApplicationBuilder UseAzureDevopsTracker(this IApplicationBuilder app, IServiceProvider serviceProvider)
3030
{
31-
var context = serviceProvider.GetService<AzureDevopsStateTrackerContext>();
31+
var context = serviceProvider.GetService<AzureDevopsTrackerContext>();
3232
context.Database.Migrate();
3333

3434
return app;

AzureDevopsTracker/Data/Context/AzureDevopsStateTrackerContext.cs renamed to AzureDevopsTracker/Data/Context/AzureDevopsTrackerContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace AzureDevopsTracker.Data.Context
77
{
8-
public class AzureDevopsStateTrackerContext : DbContext, IDisposable
8+
public class AzureDevopsTrackerContext : DbContext, IDisposable
99
{
10-
public AzureDevopsStateTrackerContext(DbContextOptions options) : base(options)
10+
public AzureDevopsTrackerContext(DbContextOptions options) : base(options)
1111
{ }
1212

1313
public DbSet<WorkItem> WorkItems { get; set; }

AzureDevopsTracker/Data/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace AzureDevopsTracker.Data
1010
{
1111
internal abstract class Repository<TEntity> : IRepository<TEntity> where TEntity : Entity
1212
{
13-
protected readonly AzureDevopsStateTrackerContext Db;
13+
protected readonly AzureDevopsTrackerContext Db;
1414
protected readonly DbSet<TEntity> DbSet;
1515

16-
public Repository(AzureDevopsStateTrackerContext db)
16+
public Repository(AzureDevopsTrackerContext db)
1717
{
1818
Db = db;
1919
DbSet = db.Set<TEntity>();

AzureDevopsTracker/Data/WorkItemRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace AzureDevopsTracker.Data
1010
{
1111
internal class WorkItemRepository : Repository<WorkItem>, IWorkItemRepository
1212
{
13-
public WorkItemRepository(AzureDevopsStateTrackerContext context) : base(context) { }
13+
public WorkItemRepository(AzureDevopsTrackerContext context) : base(context) { }
1414

1515
public async Task<WorkItem> GetByWorkItemId(string workItemId)
1616
{

AzureDevopsTracker/Extensions/HelperExtenions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static string ExtractEmail(this string user)
2525
public static string ToTextTime(this TimeSpan timeSpan)
2626
{
2727
if (timeSpan.Days > 0)
28-
return $@"{timeSpan:%d} Dia(s) {timeSpan:%h} h e {timeSpan:%m} min e {timeSpan:%s} s";
28+
return $@"{timeSpan:%d} Day(s) {timeSpan:%h} h e {timeSpan:%m} min e {timeSpan:%s} s";
2929

3030
if (timeSpan.Hours > 0)
3131
return $@"{timeSpan:%h} h e {timeSpan:%m} min e {timeSpan:%s} s";

AzureDevopsTracker/Interfaces/IAzureDevopsStateTrackerService.cs renamed to AzureDevopsTracker/Interfaces/IAzureDevopsTrackerService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace AzureDevopsTracker.Interfaces
77
{
8-
public interface IAzureDevopsStateTrackerService
8+
public interface IAzureDevopsTrackerService
99
{
1010
Task Create(CreateWorkItemDTO createDto, bool addWorkItemChange = true);
1111
Task Update(UpdatedWorkItemDTO updateDto);

AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AzureDevopsTracker/Migrations/20210831213210_UpdatingColumns.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)