-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using CoreLayer.Utilities.Results.Abstract; | ||
using EntityLayer.Concrete; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using EntityLayer.Dtos; | ||
|
||
namespace BusinessLayer.Abstract | ||
{ | ||
public interface ICategoryService | ||
{ | ||
Task<IDataResult<Category>> Get(int categoryId); | ||
Task<IDataResult<IList<Category>>> GetAll(); | ||
Task<IResult> Add(CategoryAddDto categoryAddDto,string createdByName); | ||
Task<IResult> Update(CategoryUpdateDto categoryUpdateDto, string modifiedByName); | ||
Task<IResult> Delete(int categoryId); | ||
Task<IResult> HardDelete(int categoryId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace CoreLayer.Utilities.Results.Abstract | ||
{ | ||
public interface IDataResult<out T> : IResult | ||
{ | ||
public T Data { get;} //new DataResult<Category>(ResultStatus.Success,category); | ||
//new DataResult<IList<Category>>(ResultStatus.Success,categoryList); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using CoreLayer.Utilities.Results.Abstract; | ||
using CoreLayer.Utilities.Results.ComplexTypes; | ||
using System; | ||
|
||
namespace CoreLayer.Utilities.Results.Concrete | ||
{ | ||
public class DataResult<T>:IDataResult<T> | ||
{ | ||
public DataResult(ResultStatus resultStatus, T data) | ||
{ | ||
ResultStatus = resultStatus; | ||
Data = data; | ||
} | ||
|
||
public DataResult(ResultStatus resultStatus,string message , T data) | ||
{ | ||
ResultStatus = resultStatus; | ||
Message = message; | ||
Data = data; | ||
} | ||
|
||
public DataResult(ResultStatus resultStatus, string message, T data, Exception exception) | ||
{ | ||
ResultStatus = resultStatus; | ||
Message = message; | ||
Data = data; | ||
Exception = exception; | ||
} | ||
|
||
public ResultStatus ResultStatus { get; } | ||
public string Message { get; } | ||
public Exception Exception { get; } | ||
public T Data { get; } | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using CoreLayer.Utilities.Results.Abstract; | ||
using CoreLayer.Utilities.Results.ComplexTypes; | ||
|
||
namespace CoreLayer.Utilities.Results.Concrete | ||
{ | ||
public class Result : IResult | ||
{ | ||
public Result(ResultStatus resultStatus) | ||
{ | ||
ResultStatus = resultStatus; | ||
} | ||
|
||
public Result(ResultStatus resultStatus, string message) | ||
{ | ||
ResultStatus = resultStatus; | ||
Message = message; | ||
} | ||
|
||
public Result(ResultStatus resultStatus, string message,Exception exception) | ||
{ | ||
ResultStatus = resultStatus; | ||
Message = message; | ||
Exception = exception; | ||
} | ||
|
||
public ResultStatus ResultStatus { get; } | ||
public string Message { get; } | ||
public Exception Exception { get; } | ||
//new Result(ResultStatus.Error,exception.message, exception) | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace EntityLayer.Dtos | ||
{ | ||
public class CategoryAddDto | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace EntityLayer.Dtos | ||
{ | ||
public class CategoryUpdateDto | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters