Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ekremgunes/portfolio-website

Graphic designer Portfolio Project with asp.net core mvc,ntier,web
https://github.com/ekremgunes/portfolio-website

ajax asp-net-core automapper dotnet6 error-handling fluentvalidation identity mvc-architecture n-tier-architecture ntier-architecture

Last synced: about 2 months ago
JSON representation

Graphic designer Portfolio Project with asp.net core mvc,ntier,web

Awesome Lists containing this project

README

        

Portfolio Project
![](https://github.com/ekremgunes/PortfolioProject/blob/master/panel_111.gif)
![](https://github.com/ekremgunes/PortfolioProject/blob/master/panel_222.gif)
```
I used these technologies dotnet6 , MVC -> ViewComponents ,
AJAX ,
N-Tier Architecture ,
EntityFramework (MSSQL) ,
Identity ,
AutoMapper ,
I tried SOLİD,DRY and Yagni principles ,
Error Handling Manually
```

> FluentAPI :

```c#
public class ImageConfigurations : IEntityTypeConfiguration
{
public void Configure(EntityTypeBuilder builder)
{
builder.HasKey(x => x.id);
builder.Property(x => x.imgPath).IsRequired();
builder.HasOne(x => x.contentDetail).WithMany(x => x.images).HasForeignKey(x => x.contentDetailId);
}
}
```
> Clean code examples:

```c#
public bool ContentIsValid(ContentCreateDto dto) => _createContentValidator.Validate(dto).IsValid;

public bool ContentUpdateIsValid(ContentUpdateDto dto) => _updateContentValidator.Validate(dto).IsValid;
```

> Unit Of Work :

```c#
public class Uow : IUow
{
private readonly PortfolioContext _context;

public Uow(PortfolioContext context)
{
_context = context;
}

public IRepository GetRepository() where T : BaseEntity
{
return new Repository(_context);
}

public async Task SaveChangesAsync()
{
await _context.SaveChangesAsync();
}
}
```
> Fluent Validation :
```c#
public class ServiceUpdateDtoValidator : AbstractValidator
{
public ServiceUpdateDtoValidator()
{
RuleFor(x => x.id).NotEmpty().WithMessage("data id not found");
RuleFor(x => x.serviceName).NotEmpty().WithMessage("Service name can't be empty");
RuleFor(x => x.rank).LessThan((short)101).WithMessage("Rank max value is 100");
RuleFor(x => x.rank).GreaterThan((short)0).WithMessage("Rank min value is 1");
}
}
```

You can star and look when you forget these :)