Permalink
Browse files

Resharper code cleanup pass of HearthCap.Data project

  • Loading branch information...
1 parent 9c38cf5 commit b518d7c9b9c8bd250600bdfb23436c567defebd2 @remcoros remcoros committed Aug 29, 2015
Showing with 297 additions and 325 deletions.
  1. +34 −33 HearthCap.Data/App.config
  2. +8 −8 HearthCap.Data/ArenaDeckImage.cs
  3. +20 −29 HearthCap.Data/ArenaSession.cs
  4. +6 −6 HearthCap.Data/DateTimeConvention.cs
  5. +4 −4 HearthCap.Data/Deck.cs
  6. +12 −11 HearthCap.Data/DeckImage.cs
  7. +18 −26 HearthCap.Data/DeletedArenaSession.cs
  8. +13 −12 HearthCap.Data/DeletedGameResult.cs
  9. +10 −10 HearthCap.Data/EagerLoadExtensions.cs
  10. +1 −1 HearthCap.Data/GameMode.cs
  11. +13 −12 HearthCap.Data/GameResult.cs
  12. BIN HearthCap.Data/GlobalSuppressions.cs
  13. +14 −15 HearthCap.Data/HearthStatsDbContext.cs
  14. +15 −12 HearthCap.Data/Hero.cs
  15. +1 −1 HearthCap.Data/IEntityWithId.cs
  16. +9 −8 HearthCap.Data/IRepository.cs
  17. +6 −8 HearthCap.Data/Initializer.cs
  18. +16 −18 HearthCap.Data/Migrations/201401080225106_initial.cs
  19. +4 −6 HearthCap.Data/Migrations/201401241936465_TextFiles.cs
  20. +7 −8 HearthCap.Data/Migrations/201401281924334_CascadeDelete.cs
  21. +3 −4 HearthCap.Data/Migrations/201402061539285_arena_notes.cs
  22. +2 −3 HearthCap.Data/Migrations/201402141821595_indexe.cs
  23. +3 −4 HearthCap.Data/Migrations/201402201707482_servers.cs
  24. +3 −4 HearthCap.Data/Migrations/201402280405179_decks.cs
  25. +3 −4 HearthCap.Data/Migrations/201402282130204_deckserver.cs
  26. +6 −8 HearthCap.Data/Migrations/201403091821350_deletedgames.cs
  27. +3 −4 HearthCap.Data/Migrations/201403091843393_created_timestamp.cs
  28. +4 −6 HearthCap.Data/Migrations/201403120039256_deckimages.cs
  29. +3 −4 HearthCap.Data/Migrations/201403120247059_decknotes.cs
  30. +5 −6 HearthCap.Data/Migrations/201403132323202_arenadeckimages.cs
  31. +3 −4 HearthCap.Data/Migrations/201408251353484_themename.cs
  32. +3 −5 HearthCap.Data/Migrations/Configuration.cs
  33. +4 −1 HearthCap.Data/Properties/AssemblyInfo.cs
  34. +17 −17 HearthCap.Data/Repository.cs
  35. +5 −5 HearthCap.Data/Settings.cs
  36. +4 −4 HearthCap.Data/SettingsItem.cs
  37. +12 −11 HearthCap.Data/TextFileTemplate.cs
  38. +3 −3 HearthCap.Data/ThemeConfiguration.cs
@@ -1,36 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
+
<configuration>
- <configSections>
- <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
- <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
- <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
- </configSections>
- <connectionStrings>
- <add name="db" connectionString="Data source=|DataDirectory|db.sdf;" providerName="System.Data.SqlServerCe.4.0" />
- </connectionStrings>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
- </startup>
- <entityFramework>
- <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
- <parameters>
- <parameter value="System.Data.SqlServerCe.4.0" />
- </parameters>
- </defaultConnectionFactory>
- <contexts>
- <context type="HearthCap.Data.HearthStatsDbContext, HearthCap.Data">
- <databaseInitializer type="HearthCap.Data.DbInitializer, HearthCap.Data" />
- </context>
- </contexts>
- <providers>
- <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
- <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
- </providers>
- </entityFramework>
- <system.data>
- <DbProviderFactories>
- <remove invariant="System.Data.SqlServerCe.4.0" />
- <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
- </DbProviderFactories>
- </system.data>
+ <configSections>
+ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+ </configSections>
+ <connectionStrings>
+ <add name="db" connectionString="Data source=|DataDirectory|db.sdf;" providerName="System.Data.SqlServerCe.4.0" />
+ </connectionStrings>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+ </startup>
+ <entityFramework>
+ <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
+ <parameters>
+ <parameter value="System.Data.SqlServerCe.4.0" />
+ </parameters>
+ </defaultConnectionFactory>
+ <contexts>
+ <context type="HearthCap.Data.HearthStatsDbContext, HearthCap.Data">
+ <databaseInitializer type="HearthCap.Data.DbInitializer, HearthCap.Data" />
+ </context>
+ </contexts>
+ <providers>
+ <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+ <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
+ </providers>
+ </entityFramework>
+ <system.data>
+ <DbProviderFactories>
+ <remove invariant="System.Data.SqlServerCe.4.0" />
+ <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
+ </DbProviderFactories>
+ </system.data>
</configuration>
@@ -1,15 +1,15 @@
-namespace HearthCap.Data
-{
- using System;
- using System.ComponentModel.DataAnnotations;
+using System;
+using System.ComponentModel.DataAnnotations;
+namespace HearthCap.Data
+{
public class ArenaDeckImage
{
public ArenaDeckImage()
{
- this.Id = Guid.NewGuid();
- this.Created = DateTime.Now;
- this.Modified = DateTime.Now;
+ Id = Guid.NewGuid();
+ Created = DateTime.Now;
+ Modified = DateTime.Now;
}
public Guid Id { get; set; }
@@ -24,4 +24,4 @@ public ArenaDeckImage()
[Timestamp]
public byte[] Version { get; protected set; }
}
-}
+}
@@ -1,11 +1,10 @@
-namespace HearthCap.Data
-{
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Linq;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+namespace HearthCap.Data
+{
public class ArenaSession : IEntityWithId<Guid>
{
public ArenaSession()
@@ -63,38 +62,30 @@ public ArenaSession()
public bool IsEnded
{
- get
- {
- return this.Wins == 12 || this.Losses == 3 || this.Retired;
- }
+ get { return Wins == 12 || Losses == 3 || Retired; }
}
public bool IncompleteWins
{
- get
- {
- return Wins != Games.Count(x => x.Victory);
- }
+ get { return Wins != Games.Count(x => x.Victory); }
}
public bool IncompleteLosses
{
- get
- {
- return Losses != Games.Count(x => !x.Victory);
- }
+ get { return Losses != Games.Count(x => !x.Victory); }
}
protected bool Equals(ArenaSession other)
{
- return this.Id.Equals(other.Id);
+ return Id.Equals(other.Id);
}
/// <summary>
- /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// Determines whether the specified <see cref="T:System.Object" /> is equal to the current
+ /// <see cref="T:System.Object" />.
/// </summary>
/// <returns>
- /// true if the specified object is equal to the current object; otherwise, false.
+ /// true if the specified object is equal to the current object; otherwise, false.
/// </returns>
/// <param name="obj">The object to compare with the current object. </param>
public override bool Equals(object obj)
@@ -107,32 +98,32 @@ public override bool Equals(object obj)
{
return true;
}
- if (obj.GetType() != this.GetType())
+ if (obj.GetType() != GetType())
{
return false;
}
return Equals((ArenaSession)obj);
}
/// <summary>
- /// Serves as a hash function for a particular type.
+ /// Serves as a hash function for a particular type.
/// </summary>
/// <returns>
- /// A hash code for the current <see cref="T:System.Object"/>.
+ /// A hash code for the current <see cref="T:System.Object" />.
/// </returns>
public override int GetHashCode()
{
- return this.Id.GetHashCode();
+ return Id.GetHashCode();
}
public void OrderGamesBy<T>(Func<GameResult, T> keySelector)
{
- this.Games = this.Games.OrderBy(keySelector).ToList();
+ Games = Games.OrderBy(keySelector).ToList();
}
public void OrderGamesByDescending<T>(Func<GameResult, T> keySelector)
{
- this.Games = this.Games.OrderByDescending(keySelector).ToList();
+ Games = Games.OrderByDescending(keySelector).ToList();
}
}
-}
+}
@@ -1,14 +1,14 @@
-namespace HearthCap.Data
-{
- using System;
- using System.Data.Entity.ModelConfiguration.Conventions;
+using System;
+using System.Data.Entity.ModelConfiguration.Conventions;
+namespace HearthCap.Data
+{
public class DateTimeConvention : Convention
{
public DateTimeConvention()
{
- this.Properties<DateTime>()
+ Properties<DateTime>()
.Configure(c => c.HasColumnType("datetime"));
}
}
-}
+}
@@ -1,7 +1,7 @@
-namespace HearthCap.Data
-{
- using System;
+using System;
+namespace HearthCap.Data
+{
public class Deck : IEntityWithId<Guid>
{
public Deck()
@@ -32,4 +32,4 @@ public Deck()
// TODO: more deck features :)
// like associate a hero
}
-}
+}
@@ -1,9 +1,9 @@
-namespace HearthCap.Data
-{
- using System;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+namespace HearthCap.Data
+{
public class DeckImage
{
protected DeckImage()
@@ -12,13 +12,14 @@ protected DeckImage()
public DeckImage(Deck deck)
{
- this.DeckId = deck.Id;
- this.Deck = deck;
- this.Created = DateTime.Now;
- this.Modified = DateTime.Now;
+ DeckId = deck.Id;
+ Deck = deck;
+ Created = DateTime.Now;
+ Modified = DateTime.Now;
}
- [Key, ForeignKey("Deck")]
+ [Key]
+ [ForeignKey("Deck")]
public Guid DeckId { get; protected set; }
public Deck Deck { get; protected set; }
@@ -33,4 +34,4 @@ public DeckImage(Deck deck)
[Timestamp]
public byte[] Version { get; protected set; }
}
-}
+}
@@ -1,10 +1,10 @@
-namespace HearthCap.Data
-{
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+namespace HearthCap.Data
+{
public class DeletedArenaSession : IEntityWithId<Guid>
{
public DeletedArenaSession()
@@ -52,38 +52,30 @@ public DeletedArenaSession()
public bool IsEnded
{
- get
- {
- return this.Wins == 12 || this.Losses == 3 || this.Retired;
- }
+ get { return Wins == 12 || Losses == 3 || Retired; }
}
public bool IncompleteWins
{
- get
- {
- return Wins != Games.Count(x => x.Victory);
- }
+ get { return Wins != Games.Count(x => x.Victory); }
}
public bool IncompleteLosses
{
- get
- {
- return Losses != Games.Count(x => !x.Victory);
- }
+ get { return Losses != Games.Count(x => !x.Victory); }
}
protected bool Equals(DeletedArenaSession other)
{
- return this.Id.Equals(other.Id);
+ return Id.Equals(other.Id);
}
/// <summary>
- /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// Determines whether the specified <see cref="T:System.Object" /> is equal to the current
+ /// <see cref="T:System.Object" />.
/// </summary>
/// <returns>
- /// true if the specified object is equal to the current object; otherwise, false.
+ /// true if the specified object is equal to the current object; otherwise, false.
/// </returns>
/// <param name="obj">The object to compare with the current object. </param>
public override bool Equals(object obj)
@@ -96,22 +88,22 @@ public override bool Equals(object obj)
{
return true;
}
- if (obj.GetType() != this.GetType())
+ if (obj.GetType() != GetType())
{
return false;
}
return Equals((DeletedArenaSession)obj);
}
/// <summary>
- /// Serves as a hash function for a particular type.
+ /// Serves as a hash function for a particular type.
/// </summary>
/// <returns>
- /// A hash code for the current <see cref="T:System.Object"/>.
+ /// A hash code for the current <see cref="T:System.Object" />.
/// </returns>
public override int GetHashCode()
{
- return this.Id.GetHashCode();
+ return Id.GetHashCode();
}
}
-}
+}
Oops, something went wrong.

0 comments on commit b518d7c

Please sign in to comment.