Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bb82666

Browse files
Application layer refactored
1 parent edef0e8 commit bb82666

File tree

19 files changed

+112
-132
lines changed

19 files changed

+112
-132
lines changed

‎src/AspnetRun.Application/Dtos/BaseDto.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎src/AspnetRun.Application/Dtos/CategoryDto.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42

53
namespace AspnetRun.Application.Exceptions
64
{
@@ -10,5 +8,10 @@ internal ApplicationException(string businessMessage)
108
: base(businessMessage)
119
{
1210
}
11+
12+
internal ApplicationException(string message, Exception innerException)
13+
: base(message, innerException)
14+
{
15+
}
1316
}
1417
}

‎src/AspnetRun.Application/Interfaces/ICategoryAppService.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using AspnetRun.Application.Models;
2+
using System.Collections.Generic;
3+
using System.Threading.Tasks;
4+
5+
namespace AspnetRun.Application.Interfaces
6+
{
7+
public interface ICategoryService
8+
{
9+
Task<IEnumerable<CategoryModel>> GetCategoryList();
10+
}
11+
}

‎src/AspnetRun.Application/Interfaces/IProductAppService.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using AspnetRun.Application.Models;
2+
using System.Collections.Generic;
3+
using System.Threading.Tasks;
4+
5+
namespace AspnetRun.Application.Interfaces
6+
{
7+
public interface IProductService
8+
{
9+
Task<IEnumerable<ProductModel>> GetProductList();
10+
Task<ProductModel> GetProductById(int productId);
11+
Task<IEnumerable<ProductModel>> GetProductByName(string productName);
12+
Task<IEnumerable<ProductModel>> GetProductByCategory(int categoryId);
13+
Task<ProductModel> Create(ProductModel entityDto);
14+
Task Update(ProductModel entityDto);
15+
Task Delete(ProductModel entityDto);
16+
}
17+
}

‎src/AspnetRun.Application/Mapper/ObjectMapper.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using AspnetRun.Application.Dtos;
1+
using AspnetRun.Application.Models;
22
using AspnetRun.Core.Entities;
33
using AutoMapper;
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Text;
74

85
namespace AspnetRun.Application.Mapper
96
{
@@ -26,9 +23,9 @@ private static void CreateMap()
2623
{
2724
AutoMapper.Mapper.Initialize(cfg =>
2825
{
29-
cfg.CreateMap<Product, ProductDto>()
26+
cfg.CreateMap<Product, ProductModel>()
3027
.ForMember(dest => dest.ProductName, opt => opt.MapFrom(src => src.ProductName)).ReverseMap();
31-
cfg.CreateMap<Category, CategoryDto>().ReverseMap();
28+
cfg.CreateMap<Category, CategoryModel>().ReverseMap();
3229
});
3330
}
3431
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace AspnetRun.Application.Models.Base
2+
{
3+
public class BaseModel
4+
{
5+
public int Id { get; set; }
6+
}
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using AspnetRun.Application.Models.Base;
2+
3+
namespace AspnetRun.Application.Models
4+
{
5+
public class CategoryModel : BaseModel
6+
{
7+
public string CategoryName { get; set; }
8+
public string Description { get; set; }
9+
}
10+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /