diff --git a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj index 1bf31412dd..313a6dc191 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj +++ b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs index d1132f8086..2d1a44a8c5 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs +++ b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs @@ -6,7 +6,7 @@ namespace Acme.BookStore { public BookStoreApplicationAutoMapperProfile() { - //add your custom AutoMapper configuration + //Configure your AutoMapper mapping configuration here... } } } diff --git a/samples/BookStore/src/Acme.BookStore.Application/IBookAppService.cs b/samples/BookStore/src/Acme.BookStore.Application/IBookAppService.cs index 054dce0ce3..c6609af704 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/IBookAppService.cs +++ b/samples/BookStore/src/Acme.BookStore.Application/IBookAppService.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Services; namespace Acme.BookStore { - public interface IBookAppService : + public interface IBookAppService : IAsyncCrudAppService< //Defines CRUD methods BookDto, //Used to show books Guid, //Primary key of the book entity @@ -14,4 +14,4 @@ namespace Acme.BookStore { } -} +} \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj index 46b8441db5..25cb88eb69 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj +++ b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Book.cs b/samples/BookStore/src/Acme.BookStore.Domain/Book.cs index 3119b7f257..12984a1896 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Book.cs +++ b/samples/BookStore/src/Acme.BookStore.Domain/Book.cs @@ -18,4 +18,4 @@ namespace Acme.BookStore public float Price { get; set; } } -} +} \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs index 58e0aba0d9..90290731a5 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs @@ -3,6 +3,7 @@ using Acme.BookStore.Localization.BookStore; using Acme.BookStore.Settings; using Volo.Abp.Identity; using Volo.Abp.Localization; +using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Modularity; using Volo.Abp.Settings; using Volo.Abp.VirtualFileSystem; @@ -23,6 +24,7 @@ namespace Acme.BookStore { options.Resources .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) .AddVirtualJson("/Localization/BookStore"); }); diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json index 514f291cdb..15dcae40ee 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json +++ b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json @@ -2,10 +2,10 @@ "culture": "en", "texts": { "Menu:Home": "Home", - "Menu:BookStore": "Book Store", - "Menu:Books": "Books", "Welcome": "Welcome", "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io.", + "Menu:BookStore": "Book Store", + "Menu:Books": "Books", "Name": "Name", "Type": "Type", "PublishDate": "Publish Date", diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json index c367878efd..fd17d64b8e 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json +++ b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json @@ -2,10 +2,10 @@ "culture": "tr", "texts": { "Menu:Home": "Ana sayfa", - "Menu:BookStore": "Kitap Deposu", - "Menu:Books": "Kitaplar", "Welcome": "Hoşgeldiniz", "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz.", + "Menu:BookStore": "Kitap Mağazası", + "Menu:Books": "Kitaplar", "Name": "İsim", "Type": "Tür", "PublishDate": "Yayınlanma Tarihi", diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj index 8eae431ed8..93d069283a 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj @@ -12,10 +12,10 @@ - - - - + + + + diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195241_Initial.Designer.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.Designer.cs similarity index 98% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195241_Initial.Designer.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.Designer.cs index 07bf86d485..89843d2d16 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195241_Initial.Designer.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.Designer.cs @@ -1,24 +1,25 @@ // using System; -using Acme.BookStore.EntityFrameworkCore; +using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Acme.BookStore.EntityFrameworkCore; namespace Acme.BookStore.Migrations { [DbContext(typeof(BookStoreDbContext))] - [Migration("20180701195241_Initial")] + [Migration("20180528221424_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.1-rtm-30846") - .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "2.1.0-preview2-30571") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195241_Initial.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.cs similarity index 99% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195241_Initial.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.cs index 4fefa64288..7722e7bd64 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195241_Initial.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; namespace Acme.BookStore.Migrations diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195424_Created_Book_Entity.Designer.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.Designer.cs similarity index 99% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195424_Created_Book_Entity.Designer.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.Designer.cs index 7990831265..417f22f978 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195424_Created_Book_Entity.Designer.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.Designer.cs @@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Acme.BookStore.Migrations { [DbContext(typeof(BookStoreDbContext))] - [Migration("20180701195424_Created_Book_Entity")] + [Migration("20180703184727_Created_Book_Entity")] partial class Created_Book_Entity { protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195424_Created_Book_Entity.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.cs similarity index 100% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180701195424_Created_Book_Entity.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.cs diff --git a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index 39062835ea..2fd7df9f78 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -18,7 +18,7 @@ - + @@ -27,10 +27,10 @@ - - - - + + + + diff --git a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebAutoMapperProfile.cs b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebAutoMapperProfile.cs index 239e3e9635..86c57ce794 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebAutoMapperProfile.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebAutoMapperProfile.cs @@ -6,7 +6,7 @@ namespace Acme.BookStore { public BookStoreWebAutoMapperProfile() { - //add your custom AutoMapper configuration + //Configure your AutoMapper mapping configuration here... } } } diff --git a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs index fa27496156..c40f73d925 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs @@ -17,6 +17,8 @@ using Volo.Abp.Account.Web; using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.Autofac; @@ -28,7 +30,9 @@ using Volo.Abp.Identity.Web; using Volo.Abp.Localization; using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.Web; using Volo.Abp.Threading; +using Volo.Abp.UI; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; @@ -69,34 +73,26 @@ namespace Acme.BookStore ConfigureNavigationServices(services); ConfigureAutoApiControllers(services); ConfigureSwaggerServices(services); - + services.AddAssemblyOf(); } - private static void ConfigureAutoMapper(IServiceCollection services) + private static void ConfigureDatabaseServices(IServiceCollection services, IConfigurationRoot configuration) { - services.Configure(options => + services.Configure(options => { - options.AddProfile(validate: true); + options.ConnectionStrings.Default = configuration.GetConnectionString("Default"); }); - } - private static void ConfigureAutoApiControllers(IServiceCollection services) - { - services.Configure(options => - { - options.ConventionalControllers.Create(typeof(BookStoreApplicationModule).Assembly); - }); + services.Configure(options => { options.UseSqlServer(); }); } - private static void ConfigureDatabaseServices(IServiceCollection services, IConfigurationRoot configuration) + private static void ConfigureAutoMapper(IServiceCollection services) { - services.Configure(options => + services.Configure(options => { - options.ConnectionStrings.Default = configuration.GetConnectionString("Default"); + options.AddProfile(); }); - - services.Configure(options => { options.UseSqlServer(); }); } private static void ConfigureVirtualFileSystem(IServiceCollection services, IHostingEnvironment hostingEnvironment) @@ -106,6 +102,7 @@ namespace Acme.BookStore services.Configure(options => { options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\Acme.BookStore.Domain")); + }); } } @@ -139,6 +136,14 @@ namespace Acme.BookStore }); } + private static void ConfigureAutoApiControllers(IServiceCollection services) + { + services.Configure(options => + { + options.ConventionalControllers.Create(typeof(BookStoreApplicationModule).Assembly); + }); + } + private static void ConfigureSwaggerServices(IServiceCollection services) { services.AddSwaggerGen( diff --git a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml index fef54ae3fb..dc03c197d6 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml +++ b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml @@ -11,7 +11,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml.cs b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml.cs index c419fe01c1..89a3e3bb13 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/EditModal.cshtml.cs @@ -12,7 +12,7 @@ namespace Acme.BookStore.Pages.Books [BindProperty] public CreateUpdateBookDto Book { get; set; } - + private readonly IBookAppService _bookAppService; public EditModalModel(IBookAppService bookAppService) diff --git a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml index 41edd032e8..8fe373f9af 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml +++ b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml @@ -23,14 +23,14 @@ - - @L["Actions"] - @L["Name"] - @L["Type"] - @L["PublishDate"] - @L["Price"] - @L["CreationTime"] - + + @L["Actions"] + @L["Name"] + @L["Type"] + @L["PublishDate"] + @L["Price"] + @L["CreationTime"] + diff --git a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml.cs b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml.cs index 6bd7bc6dce..cc2b70329d 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/Pages/Books/Index.cshtml.cs @@ -1,3 +1,8 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; namespace Acme.BookStore.Pages.Books @@ -6,7 +11,6 @@ namespace Acme.BookStore.Pages.Books { public void OnGet() { - } } } \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Web/Properties/launchSettings.json b/samples/BookStore/src/Acme.BookStore.Web/Properties/launchSettings.json index 79d4dca46f..6913413ef0 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Properties/launchSettings.json +++ b/samples/BookStore/src/Acme.BookStore.Web/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:54929/", + "applicationUrl": "http://localhost:53929/", "sslPort": 0 } }, @@ -21,7 +21,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:54932/" + "applicationUrl": "http://localhost:53932/" } } } \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Web/wwwroot/pages/books/index.js b/samples/BookStore/src/Acme.BookStore.Web/wwwroot/pages/books/index.js index 6f8884f262..5b99327141 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/wwwroot/pages/books/index.js +++ b/samples/BookStore/src/Acme.BookStore.Web/wwwroot/pages/books/index.js @@ -5,69 +5,44 @@ var createModal = new abp.ModalManager(abp.appPath + 'Books/CreateModal'); var editModal = new abp.ModalManager(abp.appPath + 'Books/EditModal'); - var dataTable = $('#BooksTable').DataTable({ + var dataTable = $('#BooksTable').DataTable(abp.libs.datatables.normalizeConfiguration({ order: [[1, "asc"]], ajax: abp.libs.datatables.createAjax(acme.bookStore.book.getList), columnDefs: [ { - targets: 0, - data: null, - orderable: false, - autoWidth: false, - defaultContent: '', rowAction: { - text: ' ' + l('Actions') + ' ', items: - [ - { - text: l('Edit'), - visible: function () { return true; }, - action: function (data) { - editModal.open({ - id: data.record.id - }); - } + [ + { + text: l('Edit'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + confirmMessage: function (data) { + return l('BookDeletionConfirmationMessage', data.record.name); }, - { - text: l('Delete'), - visible: function () { return true; }, - confirmMessage: function (data) { - return l('BookDeletionConfirmationMessage', data.record.name); - }, - action: function (data) { - acme.bookStore.book - .delete(data.record.id) - .then(function () { - abp.notify.info(l('SuccessfullyDeleted')); - dataTable.ajax.reload(); - }); - } + action: function (data) { + acme.bookStore.book + .delete(data.record.id) + .then(function() { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); } - ] + } + ] } }, - { - targets: 1, - data: "name" - }, - { - targets: 2, - data: "type" - }, - { - targets: 3, - data: "publishDate" - }, - { - targets: 4, - data: "price" - }, - { - targets: 5, - data: "creationTime" - } + { data: "name" }, + { data: "type" }, + { data: "publishDate" }, + { data: "price" }, + { data: "creationTime" } ] - }); + })); createModal.onResult(function () { dataTable.ajax.reload(); diff --git a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj index 87e05aa008..4bfc987755 100644 --- a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj @@ -8,19 +8,19 @@ - - + + - + - + diff --git a/samples/BookStore/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs b/samples/BookStore/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs index 78d291bb33..7ebf74aa9a 100644 --- a/samples/BookStore/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs +++ b/samples/BookStore/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs @@ -21,7 +21,9 @@ namespace Acme.BookStore public async Task Should_Get_List_Of_Books() { //Act - var result = await _bookAppService.GetListAsync(new PagedAndSortedResultRequestDto()); + var result = await _bookAppService.GetListAsync( + new PagedAndSortedResultRequestDto() + ); //Assert result.TotalCount.ShouldBeGreaterThan(0); @@ -67,4 +69,4 @@ namespace Acme.BookStore .ShouldContain(err => err.MemberNames.Any(mem => mem == "Name")); } } -} +} \ No newline at end of file diff --git a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj index 8436f9dec7..97fe750bcb 100644 --- a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj @@ -12,10 +12,10 @@ - + - +