diff --git a/global.json b/global.json index 3b965cc4..68be1221 100644 --- a/global.json +++ b/global.json @@ -1,3 +1,3 @@ { - "sdk": { "version": "1.0.1" } + "sdk": { "version": "2.0.0" } } \ No newline at end of file diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index 1a5bf786..3834ef6e 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -1,31 +1,18 @@  - General purpose Discord bot written in C#. - Kwoth - Kwoth - Kwoth - netcoreapp1.1 - true - NadekoBot - Exe - NadekoBot - 1.1.1 - $(PackageTargetFallback);dnxcore50;portable-net45+win8+wpa81 - false - false - false - false - False - 1.0.0.0 - 1.0.0.0 + netcoreapp2.0 + 2.0.0 + exe + $(AssetTargetFallback);dnxcore50;portable-net45+win8+wpa81 nadeko_icon.ico win7-x64 Debug;Release;global_nadeko + latest - 1.4.1 + 1.9.1 $(VersionPrefix).$(VersionSuffix) $(VersionPrefix) @@ -60,28 +47,24 @@ - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + - - + @@ -89,21 +72,13 @@ $(NoWarn);CS1573;CS1591 - - latest - - - latest - - - - latest + true - - + + diff --git a/src/NadekoBot/NadekoBot.nuspec b/src/NadekoBot/NadekoBot.nuspec deleted file mode 100644 index 109f83d5..00000000 --- a/src/NadekoBot/NadekoBot.nuspec +++ /dev/null @@ -1,15 +0,0 @@ - - - - NadekoBot - 1.4.0-2$suffix$ - NadekoBot - Kwoth - Kwoth - General purpose discord chat bot written in C#. - nadeko;bot;nadekobot;discord bot - https://github.com/Kwoth/NadekoBot - https://choosealicense.com/licenses/unlicense/ - false - - \ No newline at end of file diff --git a/src/NadekoBot/NadekoBot.xproj.DotSettings b/src/NadekoBot/NadekoBot.xproj.DotSettings deleted file mode 100644 index c5dd7773..00000000 --- a/src/NadekoBot/NadekoBot.xproj.DotSettings +++ /dev/null @@ -1,7 +0,0 @@ - - True - True - True - True - True - True \ No newline at end of file diff --git a/src/NadekoBot/Properties/AssemblyInfo.cs b/src/NadekoBot/Properties/AssemblyInfo.cs deleted file mode 100644 index ca3bd293..00000000 --- a/src/NadekoBot/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NadekoBot")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyInformationalVersion("1.0")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f8225ac4-3cbc-40b4-bcf3-1cacf276bf29")] diff --git a/src/NadekoBot/Services/Database/NadekoContext.cs b/src/NadekoBot/Services/Database/NadekoContext.cs index 0df96909..7fd511de 100644 --- a/src/NadekoBot/Services/Database/NadekoContext.cs +++ b/src/NadekoBot/Services/Database/NadekoContext.cs @@ -3,22 +3,16 @@ using System.Collections.Generic; using System.Linq; using NadekoBot.Services.Database.Models; using NadekoBot.Extensions; -using Microsoft.EntityFrameworkCore.Infrastructure; using System; +using Microsoft.EntityFrameworkCore.Design; namespace NadekoBot.Services.Database { - - public class NadekoContextFactory : IDbContextFactory + public class NadekoContextFactory : IDesignTimeDbContextFactory { - /// - /// :\ Used for migrations - /// - /// - /// - public NadekoContext Create(DbContextFactoryOptions options) + public NadekoContext CreateDbContext(string[] args) { - var optionsBuilder = new DbContextOptionsBuilder(); + var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlite("Filename=./data/NadekoBot.db"); var ctx = new NadekoContext(optionsBuilder.Options); ctx.Database.SetCommandTimeout(60); @@ -58,12 +52,7 @@ namespace NadekoBot.Services.Database public DbSet ModulePrefixes { get; set; } public DbSet RewardedUsers { get; set; } - public NadekoContext() : base() - { - - } - - public NadekoContext(DbContextOptions options) : base(options) + public NadekoContext(DbContextOptions options) : base(options) { } @@ -231,7 +220,7 @@ namespace NadekoBot.Services.Database musicPlaylistEntity .HasMany(p => p.Songs) .WithOne() - .OnDelete(Microsoft.EntityFrameworkCore.Metadata.DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade); #endregion diff --git a/src/NadekoBot/Services/DbService.cs b/src/NadekoBot/Services/DbService.cs index 5bc9f6bf..277bc33d 100644 --- a/src/NadekoBot/Services/DbService.cs +++ b/src/NadekoBot/Services/DbService.cs @@ -6,19 +6,19 @@ namespace NadekoBot.Services { public class DbService { - private readonly DbContextOptions options; - private readonly DbContextOptions migrateOptions; + private readonly DbContextOptions options; + private readonly DbContextOptions migrateOptions; private readonly string _connectionString; public DbService(IBotCredentials creds) { _connectionString = creds.Db.ConnectionString; - var optionsBuilder = new DbContextOptionsBuilder(); + var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlite(creds.Db.ConnectionString); options = optionsBuilder.Options; - optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlite(creds.Db.ConnectionString, x => x.SuppressForeignKeyEnforcement()); migrateOptions = optionsBuilder.Options; } diff --git a/src/NadekoBot/Services/LogSetup.cs b/src/NadekoBot/Services/LogSetup.cs index 0d3234ee..9cf85799 100644 --- a/src/NadekoBot/Services/LogSetup.cs +++ b/src/NadekoBot/Services/LogSetup.cs @@ -11,7 +11,7 @@ namespace NadekoBot.Services var logConfig = new LoggingConfiguration(); var consoleTarget = new ColoredConsoleTarget() { - Layout = @"${date:format=HH\:mm\:ss} ${logger} | ${message}" + Layout = @"${date:format=HH\:mm\:ss} ${logger:shortName=True} | ${message}" }; logConfig.AddTarget("Console", consoleTarget);