├── ConsoleApp1
├── ConsoleApp1.csproj
└── Program.cs
├── Business
├── CCS
│ ├── ILogger.cs
│ ├── DatabaseLogger.cs
│ └── FileLogger.cs
├── Abstract
│ ├── IUserService.cs
│ ├── ICategoryService.cs
│ ├── IAuthService.cs
│ └── IProductService.cs
├── Concrete
│ ├── UserManager.cs
│ ├── CategoryManager.cs
│ ├── AuthManager.cs
│ └── ProductManager.cs
├── Business.csproj
├── BusinessAspects
│ └── Autofac
│ │ └── SecuredOperation.cs
├── Constants
│ └── Messages.cs
├── ValidationRules
│ └── FluentValidation
│ │ └── ProductValidator.cs
└── DependencyResolvers
│ └── Autofac
│ └── AutofacBusinessModule.cs
├── DataAccess
├── Abstract
│ ├── IOrderDal.cs
│ ├── ICustomerDal.cs
│ ├── ICategoryDal.cs
│ ├── IUserDal.cs
│ └── IProductDal.cs
├── Concrete
│ ├── EntityFramework
│ │ ├── EfOrderDal.cs
│ │ ├── EfCategoryDal.cs
│ │ ├── NorthwindContext.cs
│ │ ├── EfUserDal.cs
│ │ └── EfProductDal.cs
│ └── InMemory
│ │ └── InMemoryProductDal.cs
└── DataAccess.csproj
├── Entities
├── DTOs
│ ├── UserForLoginDto.cs
│ ├── UserForRegisterDto.cs
│ └── ProductDetailDto.cs
├── Concrete
│ ├── Category.cs
│ ├── Customer.cs
│ ├── Order.cs
│ └── Product.cs
└── Entities.csproj
├── ConsoleUI
├── ConsoleUI.csproj
└── Program.cs
├── MyFinalProject.sln
├── .gitattributes
└── .gitignore
/ConsoleApp1/ConsoleApp1.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Business/CCS/ILogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Business.CCS
6 | {
7 | public interface ILogger
8 | {
9 | void Log();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/ConsoleApp1/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ConsoleApp1
4 | {
5 | class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | Console.WriteLine("Hello World!");
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Business/CCS/DatabaseLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Business.CCS
4 | {
5 | public class DatabaseLogger : ILogger
6 | {
7 | public void Log()
8 | {
9 | Console.WriteLine("Veritabanına loglandı");
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/DataAccess/Abstract/IOrderDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess;
2 | using Entities.Concrete;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace DataAccess.Abstract
8 | {
9 | public interface IOrderDal:IEntityRepository
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/DataAccess/Abstract/ICustomerDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess;
2 | using Entities.Concrete;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace DataAccess.Abstract
8 | {
9 | public interface ICustomerDal:IEntityRepository
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/DataAccess/Abstract/ICategoryDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess;
2 | using Entities.Concrete;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace DataAccess.Abstract
8 | {
9 | public interface ICategoryDal:IEntityRepository
10 | {
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Business/CCS/FileLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Business.CCS
6 | {
7 | public class FileLogger : ILogger
8 | {
9 | public void Log()
10 | {
11 | Console.WriteLine("Dosyaya loglandı");
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Entities/DTOs/UserForLoginDto.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.DTOs
7 | {
8 | public class UserForLoginDto : IDto
9 | {
10 | public string Email { get; set; }
11 | public string Password { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/DataAccess/Abstract/IUserDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess;
2 | using Core.Entities.Concrete;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace DataAccess.Abstract
8 | {
9 | public interface IUserDal : IEntityRepository
10 | {
11 | List GetClaims(User user);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Entities/DTOs/UserForRegisterDto.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 |
3 | namespace Entities.DTOs
4 | {
5 | public class UserForRegisterDto : IDto
6 | {
7 | public string Email { get; set; }
8 | public string Password { get; set; }
9 | public string FirstName { get; set; }
10 | public string LastName { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Business/Abstract/IUserService.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities.Concrete;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Business.Abstract
7 | {
8 | public interface IUserService
9 | {
10 | List GetClaims(User user);
11 | void Add(User user);
12 | User GetByMail(string email);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/DataAccess/Abstract/IProductDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess;
2 | using Entities.Concrete;
3 | using Entities.DTOs;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace DataAccess.Abstract
9 | {
10 | public interface IProductDal:IEntityRepository
11 | {
12 | List GetProductDetails();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Business/Abstract/ICategoryService.cs:
--------------------------------------------------------------------------------
1 | using Core.Utilities.Results;
2 | using Entities.Concrete;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace Business.Abstract
8 | {
9 | public interface ICategoryService
10 | {
11 | IDataResult> GetAll();
12 | IDataResult GetById(int categoryId);
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Entities/Concrete/Category.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.Concrete
7 | {
8 | public class Category:IEntity
9 | {
10 | //Çıplak class kalmasın bu yüzden guruplamalar yaparız
11 | public int CategoryId { get; set; }
12 | public string CategoryName { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/DataAccess/Concrete/EntityFramework/EfOrderDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess.EntityFramework;
2 | using DataAccess.Abstract;
3 | using Entities.Concrete;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace DataAccess.Concrete.EntityFramework
9 | {
10 | public class EfOrderDal : EfEntityRepositoryBase,IOrderDal
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Entities/Entities.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Entities/Concrete/Customer.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.Concrete
7 | {
8 | public class Customer:IEntity
9 | {
10 | public string CustomerId { get; set; }
11 | public string ContactName { get; set; }
12 | public string CompanyName { get; set; }
13 | public string City { get; set; }
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Entities/DTOs/ProductDetailDto.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.DTOs
7 | {
8 | public class ProductDetailDto:IDto
9 | {
10 | public int ProductId { get; set; }
11 | public string ProductName { get; set; }
12 | public string CategoryName { get; set; }
13 | public short UnitsInStock { get; set; }
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/DataAccess/Concrete/EntityFramework/EfCategoryDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess.EntityFramework;
2 | using DataAccess.Abstract;
3 | using Entities.Concrete;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq.Expressions;
7 | using System.Text;
8 |
9 | namespace DataAccess.Concrete.EntityFramework
10 | {
11 | public class EfCategoryDal : EfEntityRepositoryBase, ICategoryDal
12 | {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ConsoleUI/ConsoleUI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Entities/Concrete/Order.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.Concrete
7 | {
8 | public class Order:IEntity
9 | {
10 | public int OrderId { get; set; }
11 | public string CustomerId { get; set; }
12 | public int EmployeeId { get; set; }
13 | public DateTime OrderDate { get; set; }
14 | public string ShipCity { get; set; }
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/DataAccess/DataAccess.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Entities/Concrete/Product.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.Concrete
7 | {
8 | //internal sadece Entities erişebilir demek oluyor
9 |
10 | public class Product:IEntity
11 | {
12 | public int ProductId { get; set; }
13 | public int CategoryId { get; set; }
14 | public string ProductName { get; set; }
15 | public short UnitsInStock { get; set; }
16 | public decimal UnitPrice { get; set; }
17 |
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/Business/Abstract/IAuthService.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities.Concrete;
2 | using Core.Utilities.Results;
3 | using Core.Utilities.Security.JWT;
4 | using Entities.DTOs;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Text;
8 |
9 | namespace Business.Abstract
10 | {
11 | public interface IAuthService
12 | {
13 | IDataResult Register(UserForRegisterDto userForRegisterDto, string password);
14 | IDataResult Login(UserForLoginDto userForLoginDto);
15 | IResult UserExists(string email);
16 | IDataResult CreateAccessToken(User user);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Business/Concrete/UserManager.cs:
--------------------------------------------------------------------------------
1 | using Business.Abstract;
2 | using Core.Entities.Concrete;
3 | using DataAccess.Abstract;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace Business.Concrete
9 | {
10 | public class UserManager : IUserService
11 | {
12 | IUserDal _userDal;
13 |
14 | public UserManager(IUserDal userDal)
15 | {
16 | _userDal = userDal;
17 | }
18 |
19 | public List GetClaims(User user)
20 | {
21 | return _userDal.GetClaims(user);
22 | }
23 |
24 | public void Add(User user)
25 | {
26 | _userDal.Add(user);
27 | }
28 |
29 | public User GetByMail(string email)
30 | {
31 | return _userDal.Get(u => u.Email == email);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Business/Business.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Business/Concrete/CategoryManager.cs:
--------------------------------------------------------------------------------
1 | using Business.Abstract;
2 | using Core.Utilities.Results;
3 | using DataAccess.Abstract;
4 | using Entities.Concrete;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Text;
8 |
9 | namespace Business.Concrete
10 | {
11 | public class CategoryManager : ICategoryService
12 | {
13 | ICategoryDal _categoryDal;
14 |
15 | public CategoryManager(ICategoryDal categoryDal)
16 | {
17 | _categoryDal = categoryDal;
18 | }
19 |
20 | public IDataResult> GetAll()
21 | {
22 | //iş kodları
23 | return new SuccessDataResult>(_categoryDal.GetAll());
24 | }
25 |
26 | public IDataResult GetById(int categoryId)
27 | {
28 | //Select * from Categories where CategoryId = ? //? ne gçnderirsen demek oluyor
29 | return new SuccessDataResult(_categoryDal.Get(c => c.CategoryId == categoryId));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Business/Abstract/IProductService.cs:
--------------------------------------------------------------------------------
1 | using Core.Utilities.Results;
2 | using Entities.Concrete;
3 | using Entities.DTOs;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace Business.Abstract
9 | {
10 | //SOLID (I) harfi kullanmayacağın birşeyi yazma demek
11 | public interface IProductService
12 | {//IDataResult hem mesajı hem de data da ki yapıyı(List döndüre bilecek birşey olacak
13 | //List artık T oldu
14 | IDataResult> GetAll();
15 | IDataResult> GetAllByCategoryId(int id);
16 | IDataResult> GetByUnitPrice(decimal min, decimal max);
17 | IDataResult> GetProductDetails();
18 | IDataResult GetById(int ProductId);//sadece ürün ile ilgili bilgiler için yazılır
19 | IResult Add(Product product);//burda yok o yüzden IDataResult olmaz
20 | IResult Update(Product product);
21 |
22 |
23 | IResult AddTransactionalTest(Product product);
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/DataAccess/Concrete/EntityFramework/NorthwindContext.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities.Concrete;
2 | using Entities.Concrete;
3 | using Microsoft.EntityFrameworkCore;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace DataAccess.Concrete.EntityFramework
9 | {
10 | //Context: Db tabloları ile proje class larını bağlamak
11 | public class NorthwindContext:DbContext
12 | {
13 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
14 | {
15 | optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Northwind;Trusted_Connection=true");
16 | }
17 |
18 | public DbSet Products { get; set; }
19 | public DbSet Categories { get; set; }
20 | public DbSet Customers { get; set; }
21 | public DbSet Orders { get; set; }
22 | public DbSet OperationClaims { get; set; }
23 | public DbSet Users { get; set; }
24 | public DbSet UserOperationClaims { get; set; }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DataAccess/Concrete/EntityFramework/EfUserDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess.EntityFramework;
2 | using Core.Entities.Concrete;
3 | using DataAccess.Abstract;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 | using System.Linq;
8 |
9 | namespace DataAccess.Concrete.EntityFramework
10 | {
11 | public class EfUserDal : EfEntityRepositoryBase, IUserDal
12 | {
13 | public List GetClaims(User user)
14 | {
15 | using (var context = new NorthwindContext())
16 | {
17 | var result = from operationClaim in context.OperationClaims
18 | join userOperationClaim in context.UserOperationClaims
19 | on operationClaim.Id equals userOperationClaim.OperationClaimId
20 | where userOperationClaim.UserId == user.Id
21 | select new OperationClaim { Id = operationClaim.Id, Name = operationClaim.Name };
22 | return result.ToList();
23 |
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Business/BusinessAspects/Autofac/SecuredOperation.cs:
--------------------------------------------------------------------------------
1 | using Castle.DynamicProxy;
2 | using Core.Utilities.Interceptors;
3 | using Core.Utilities.IoC;
4 | using Microsoft.AspNetCore.Http;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Text;
8 | using Microsoft.Extensions.DependencyInjection;
9 | using Core.Extensions;
10 | using Business.Constants;
11 |
12 | namespace Business.BusinessAspects.Autofac
13 | {
14 | //JWT
15 | public class SecuredOperation : MethodInterception
16 | {
17 | private string[] _roles;
18 | private IHttpContextAccessor _httpContextAccessor;
19 |
20 | public SecuredOperation(string roles)
21 | {
22 | _roles = roles.Split(',');
23 | _httpContextAccessor = ServiceTool.ServiceProvider.GetService();
24 |
25 | }
26 |
27 | protected override void OnBefore(IInvocation invocation)
28 | {
29 | var roleClaims = _httpContextAccessor.HttpContext.User.ClaimRoles();
30 | foreach (var role in _roles)
31 | {
32 | if (roleClaims.Contains(role))
33 | {
34 | return;
35 | }
36 | }
37 | throw new Exception(Messages.AuthorizationDenied);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ConsoleUI/Program.cs:
--------------------------------------------------------------------------------
1 | using Business.Concrete;
2 | using DataAccess.Concrete.EntityFramework;
3 | using DataAccess.Concrete.InMemory;
4 | using System;
5 |
6 | namespace ConsoleUI
7 | {
8 | class Program
9 | {
10 | static void Main(string[] args)
11 | {
12 | //DTO Data Transformation Object
13 | ProductTest();
14 | //CategoryTest();
15 |
16 | }
17 |
18 | private static void CategoryTest()
19 | {
20 | CategoryManager categoryManager = new CategoryManager(new EfCategoryDal());
21 | foreach (var category in categoryManager.GetAll().Data)
22 | {
23 | Console.WriteLine(category.CategoryName);
24 | }
25 | }
26 |
27 | private static void ProductTest()
28 | {
29 | ProductManager productManager = new ProductManager(new EfProductDal()
30 | , new CategoryManager(new EfCategoryDal()));
31 |
32 | var result = productManager.GetProductDetails();
33 |
34 | if (result.Success==true)
35 | {
36 | foreach (var product in result.Data)
37 | {
38 | Console.WriteLine(product.ProductName + "/" + product.CategoryName);
39 | }
40 | }
41 | else
42 | {
43 | Console.WriteLine(result.Message);
44 | }
45 |
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Business/Constants/Messages.cs:
--------------------------------------------------------------------------------
1 | using Core.Entities.Concrete;
2 | using Entities.Concrete;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Runtime.Serialization;
6 | using System.Text;
7 |
8 | namespace Business.Constants
9 | {//Constants proje sabitlerini yazacağımız yerdir
10 | //static eklendi
11 | public static class Messages
12 | {
13 | public static string ProductAdded = "Ürün eklendi";
14 | public static string ProductNameInvalid = "Ürün ismi geçersiz";
15 | public static string MeintenanceTime = "Sistem bakımda";
16 | public static string ProductsListed = "Ürünler listelendi";
17 | public static string Errors = "Hata!";
18 | public static string ProductCountOfCategoryError="Kategoriye en fazla 10 ürün ekleyebilirsiniz";
19 | public static string ProductNameAlreadyExists = "Bu isimde zaten başka bir ürün var";
20 | public static string CategoryLimitExceded = "Kategori limiti aşıldıüı için yeni ürün eklenemiyor";
21 | public static string AuthorizationDenied= "Yetkiniz yok.";
22 | public static string UserRegistered= "Kayıt oldu";
23 | public static string UserNotFound = "Kullanıcı bulunamadı";
24 | public static string PasswordError = "Parola hatası";
25 | public static string SuccessfulLogin= "Başarılı giriş";
26 | public static string UserAlreadyExists= "Kullanıcı mevcut";
27 | public static string AccessTokenCreated= "Token oluşturuldu";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/DataAccess/Concrete/EntityFramework/EfProductDal.cs:
--------------------------------------------------------------------------------
1 | using Core.DataAccess.EntityFramework;
2 | using DataAccess.Abstract;
3 | using Entities.Concrete;
4 | using Entities.DTOs;
5 | using Microsoft.EntityFrameworkCore;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Linq.Expressions;
10 | using System.Text;
11 |
12 | namespace DataAccess.Concrete.EntityFramework
13 | {
14 | //NuGet
15 | //EfProductDal da olması greken implementler EfRepositoryBase te var diyoruz
16 | public class EfProductDal : EfEntityRepositoryBase, IProductDal
17 | {
18 | public List GetProductDetails()
19 | {
20 | using (NorthwindContext context= new NorthwindContext())
21 | {
22 | //ürünler ile kategorileri join et demek
23 | var result = from p in context.Products
24 | join c in context.Categories
25 | on p.CategoryId equals c.CategoryId
26 | select new ProductDetailDto
27 | {
28 | ProductId = p.ProductId,
29 | ProductName = p.ProductName,
30 | CategoryName = c.CategoryName,
31 | UnitsInStock = p.UnitsInStock
32 | };
33 | return result.ToList();
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Business/ValidationRules/FluentValidation/ProductValidator.cs:
--------------------------------------------------------------------------------
1 | using Entities.Concrete;
2 | using FluentValidation;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace Business.ValidationRules.FluentValidation
8 | {
9 | public class ProductValidator:AbstractValidator//AbstractValidator NuGet FluentValidation dan using ediliyor
10 | {
11 | //kuralları ctor ların içine yazıyoruz
12 | public ProductValidator()
13 | {//RuleFor kim için kural demek
14 | RuleFor(p => p.ProductName).NotEmpty();//boş olamaz
15 | RuleFor(p =>p.ProductName).MinimumLength(2);//en az iki karakter olmalı
16 | RuleFor(p => p.UnitPrice).NotEmpty();
17 | RuleFor(p => p.UnitPrice).GreaterThan(0);//0 dan büyük olmalı
18 | RuleFor(p => p.UnitPrice).GreaterThanOrEqualTo(10).When(p => p.CategoryId == 1);//10 dan büyük olmalı ne zaman p nin CategoryId si 1 e eşit olduğu zaman
19 | RuleFor(p => p.ProductName).Must(StartWithA).WithMessage("Ürünler A harfi ile başlamalı");//burada olmayan bi komuta yazıyoruz komutumuz A ile başlamalı method ekliyoruz burada ampulden generate method diyerek ekliyoruz
20 | }//Ctrl K+D kodları düzenler //WithMessage() ek bi mesaj vermek istersek kullanabiliriz
21 |
22 | private bool StartWithA(string arg)//bool = eğer true döndürürsen kurala uygun false döndürürsen uygun değil demek
23 | {//arg ise gönderdiğimiz parametre yani ProductName
24 | return arg.StartsWith("A");
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Business/DependencyResolvers/Autofac/AutofacBusinessModule.cs:
--------------------------------------------------------------------------------
1 | using Autofac;
2 | using Autofac.Extras.DynamicProxy;
3 | using Business.Abstract;
4 | using Business.CCS;
5 | using Business.Concrete;
6 | using Castle.DynamicProxy;
7 | using Core.Utilities.Interceptors;
8 | using Core.Utilities.Security.JWT;
9 | using DataAccess.Abstract;
10 | using DataAccess.Concrete.EntityFramework;
11 | using Microsoft.AspNetCore.Http;
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Text;
15 |
16 | namespace Business.DependencyResolvers.Autofac
17 | {
18 | public class AutofacBusinessModule:Module//Autofac modül olduğunu söyledik
19 | {
20 | protected override void Load(ContainerBuilder builder)//over deyip space ye bastık load ı bulduk yapı oluştu
21 | {
22 | builder.RegisterType().As().SingleInstance();//biri IProductService isterse ona ProductManager i ver demek
23 | builder.RegisterType().As().SingleInstance();//EfProductDal ı new le ver demek Sürekli new lenmesi yerine SingleInstance() bir defa new leyip herkese veriyor onu
24 |
25 | builder.RegisterType().As().SingleInstance();
26 | builder.RegisterType().As().SingleInstance();
27 |
28 | builder.RegisterType().As();
29 | builder.RegisterType().As();
30 |
31 | builder.RegisterType().As();
32 | builder.RegisterType().As();
33 |
34 |
35 | var assembly = System.Reflection.Assembly.GetExecutingAssembly();
36 |
37 | builder.RegisterAssemblyTypes(assembly).AsImplementedInterfaces()
38 | .EnableInterfaceInterceptors(new ProxyGenerationOptions()
39 | {
40 | Selector = new AspectInterceptorSelector()
41 | }).SingleInstance();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/MyFinalProject.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31129.286
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccess", "DataAccess\DataAccess.csproj", "{09F0C2C1-DC89-4A8B-BD2D-0A718E130B7E}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Business", "Business\Business.csproj", "{FE9FB9E7-54D7-4F9B-9A6B-6F85485F81B9}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entities", "Entities\Entities.csproj", "{278BA9E5-10F2-446D-A073-B44E1A69E226}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleUI", "ConsoleUI\ConsoleUI.csproj", "{815FF7F0-B270-40B3-B694-9BCD715AD0D6}"
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {09F0C2C1-DC89-4A8B-BD2D-0A718E130B7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {09F0C2C1-DC89-4A8B-BD2D-0A718E130B7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {09F0C2C1-DC89-4A8B-BD2D-0A718E130B7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {09F0C2C1-DC89-4A8B-BD2D-0A718E130B7E}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {FE9FB9E7-54D7-4F9B-9A6B-6F85485F81B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {FE9FB9E7-54D7-4F9B-9A6B-6F85485F81B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {FE9FB9E7-54D7-4F9B-9A6B-6F85485F81B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {FE9FB9E7-54D7-4F9B-9A6B-6F85485F81B9}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {278BA9E5-10F2-446D-A073-B44E1A69E226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {278BA9E5-10F2-446D-A073-B44E1A69E226}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {278BA9E5-10F2-446D-A073-B44E1A69E226}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {278BA9E5-10F2-446D-A073-B44E1A69E226}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {815FF7F0-B270-40B3-B694-9BCD715AD0D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {815FF7F0-B270-40B3-B694-9BCD715AD0D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {815FF7F0-B270-40B3-B694-9BCD715AD0D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {815FF7F0-B270-40B3-B694-9BCD715AD0D6}.Release|Any CPU.Build.0 = Release|Any CPU
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {542A2F18-0A58-4015-9D32-90301D6230E7}
42 | EndGlobalSection
43 | EndGlobal
44 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Business/Concrete/AuthManager.cs:
--------------------------------------------------------------------------------
1 | using Business.Abstract;
2 | using Business.Constants;
3 | using Core.Entities.Concrete;
4 | using Core.Utilities.Results;
5 | using Core.Utilities.Security.Hashing;
6 | using Core.Utilities.Security.JWT;
7 | using Entities.DTOs;
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Text;
11 |
12 | namespace Business.Concrete
13 | {
14 | public class AuthManager : IAuthService
15 | {
16 | private IUserService _userService;
17 | private ITokenHelper _tokenHelper;
18 |
19 | public AuthManager(IUserService userService, ITokenHelper tokenHelper)
20 | {
21 | _userService = userService;
22 | _tokenHelper = tokenHelper;
23 | }
24 |
25 | public IDataResult Register(UserForRegisterDto userForRegisterDto, string password)
26 | {
27 | byte[] passwordHash, passwordSalt;
28 | HashingHelper.CreatePasswordHash(password, out passwordHash, out passwordSalt);
29 | var user = new User
30 | {
31 | Email = userForRegisterDto.Email,
32 | FirstName = userForRegisterDto.FirstName,
33 | LastName = userForRegisterDto.LastName,
34 | PasswordHash = passwordHash,
35 | PasswordSalt = passwordSalt,
36 | Status = true
37 | };
38 | _userService.Add(user);
39 | return new SuccessDataResult(user, Messages.UserRegistered);
40 | }
41 |
42 | public IDataResult Login(UserForLoginDto userForLoginDto)
43 | {
44 | var userToCheck = _userService.GetByMail(userForLoginDto.Email);
45 | if (userToCheck == null)
46 | {
47 | return new ErrorDataResult(Messages.UserNotFound);
48 | }
49 |
50 | if (!HashingHelper.VerifyPasswordHash(userForLoginDto.Password, userToCheck.PasswordHash, userToCheck.PasswordSalt))
51 | {
52 | return new ErrorDataResult(Messages.PasswordError);
53 | }
54 |
55 | return new SuccessDataResult(userToCheck, Messages.SuccessfulLogin);
56 | }
57 |
58 | public IResult UserExists(string email)
59 | {
60 | if (_userService.GetByMail(email) != null)
61 | {
62 | return new ErrorResult(Messages.UserAlreadyExists);
63 | }
64 | return new SuccessResult();
65 | }
66 |
67 | public IDataResult CreateAccessToken(User user)
68 | {
69 | var claims = _userService.GetClaims(user);
70 | var accessToken = _tokenHelper.CreateToken(user, claims);
71 | return new SuccessDataResult(accessToken, Messages.AccessTokenCreated);
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/DataAccess/Concrete/InMemory/InMemoryProductDal.cs:
--------------------------------------------------------------------------------
1 | using DataAccess.Abstract;
2 | using Entities.Concrete;
3 | using Entities.DTOs;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Linq.Expressions;
8 | using System.Text;
9 |
10 | namespace DataAccess.Concrete.InMemory
11 | {
12 | public class InMemoryProductDal : IProductDal
13 | {
14 | List _products;
15 | //ctor yazıldı aşağıda
16 | public InMemoryProductDal()
17 | {
18 | //Bu veriler sanki Oracle,Sql Server,Postgres,MongoDb den geliyormuş gibi simüle ediyoruz
19 | _products = new List {
20 | new Product{ProductId=1, CategoryId=1, ProductName="Bardak", UnitPrice=15, UnitsInStock=15},
21 | new Product{ProductId=2, CategoryId=1, ProductName="Kamera", UnitPrice=500, UnitsInStock=3},
22 | new Product{ProductId=3, CategoryId=2, ProductName="Telefon", UnitPrice=1500, UnitsInStock=3},
23 | new Product{ProductId=4, CategoryId=2, ProductName="Klavye", UnitPrice=150, UnitsInStock=65},
24 | new Product{ProductId=5, CategoryId=2, ProductName="Fare", UnitPrice=85, UnitsInStock=1}
25 | };
26 | }
27 | public void Add(Product product)
28 | {
29 | _products.Add(product);
30 | }
31 |
32 | public void Delete(Product product)
33 | {
34 | //buraya _product.Remove(product); yazıldığında neden silmez? çünkü ıd den silinmesi lazım o yüzden Linq kullanılır
35 | //LINQ-Language Integrated Query (Dile gömülü sorgulama)// (>) Lambda işareti
36 | //foreach döngüsünün kısaltılmışı var aşağıda = işaretinden sonrasında
37 |
38 | Product productToDelete = _products.SingleOrDefault(p=>p.ProductId==product.ProductId);
39 |
40 | _products.Remove(productToDelete);
41 |
42 | }
43 |
44 | public List GetAll()
45 | {
46 | return _products;
47 | }
48 |
49 | public void Update(Product product)
50 | {
51 | //gönderdiğim ürün ıd'sine sahip olan listedeki ürünü bul demek sonrakiler ise güncellemeler
52 | Product productToUpdate = _products.SingleOrDefault(p => p.ProductId == product.ProductId);
53 | productToUpdate.ProductName = product.ProductName;
54 | productToUpdate.ProductId = product.ProductId;
55 | productToUpdate.UnitPrice = product.UnitPrice;
56 | productToUpdate.UnitsInStock = product.UnitsInStock;
57 |
58 | }
59 |
60 | public List GetAllByCategory(int categoryId)
61 | {
62 | return _products.Where(p => p.CategoryId == categoryId).ToList();
63 | }
64 |
65 | public List GetAll(Expression> filter = null)
66 | {
67 | throw new NotImplementedException();
68 | }
69 |
70 | public Product Get(Expression> filter)
71 | {
72 | throw new NotImplementedException();
73 | }
74 |
75 | public List GetProductDetails()
76 | {
77 | throw new NotImplementedException();
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Business/Concrete/ProductManager.cs:
--------------------------------------------------------------------------------
1 | using Business.Abstract;
2 | using Business.BusinessAspects.Autofac;
3 | using Business.CCS;
4 | using Business.Constants;
5 | using Business.ValidationRules.FluentValidation;
6 | using Core.Aspects.Autofac.Caching;
7 | using Core.Aspects.Autofac.Performance;
8 | using Core.Aspects.Autofac.Transaction;
9 | using Core.Aspects.Autofac.Validation;
10 | using Core.CrossCuttingConcerns.Validation;
11 | using Core.Utilities.Business;
12 | using Core.Utilities.Results;
13 | using DataAccess.Abstract;
14 | using DataAccess.Concrete.InMemory;
15 | using Entities.Concrete;
16 | using Entities.DTOs;
17 | using FluentValidation;
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Linq;
21 | using System.Text;
22 | using System.Transactions;
23 |
24 | namespace Business.Concrete
25 | {//Bir Entity Manager kendisi hariç başka Dal ı enjekte edemez etmez.. Onun yerine örneğin CategoryId yi kullanacaksak iş komutu olarak ICategoryService yi injection ederiz
26 | public class ProductManager : IProductService
27 | {
28 | IProductDal _productDal;
29 | ICategoryService _categoryService;
30 |
31 | public ProductManager(IProductDal productDal, ICategoryService categoryService)
32 | {
33 | _productDal = productDal;
34 | _categoryService = categoryService;
35 | }
36 |
37 | //Claim(İddia etmek) yani yetkisi var anlamında
38 | [SecuredOperation("product.add,admin")]
39 | [ValidationAspect(typeof(ProductValidator))]//aşagıdaki metodu doğrula ProductValidator ü kullanarak demek(Bu bir Attribute)
40 | [CacheRemoveAspect("IProductService.Add")]
41 | public IResult Add(Product product)
42 | {
43 | //business codes
44 | //validation (Burada product ın yapısal uyumunu kontrol için yazılan kodlar doğrulama oluyor)ama örneğin bir kişi kredi başvurusu yapıyor ve o kişinin başvuru nitelikleri karşılanıyor mu diye kontrol edilmesi ve verilip verilmemesi validation değildir
45 |
46 | //resul kurala uymayan var ise doludur yok ise boştur hata kımını içine attık yani
47 | IResult result = BusinessRules.Run(CheckIfProductNameExists(product.ProductName),
48 | CheckIfProductCountOfCategoryCorrect(product.CategoryId), CheckIfCategoryLimitExceded());
49 |
50 | if(result != null)//burada result null değilse yani kurala uymayan bir durum var ise
51 | {
52 | return result;
53 | }
54 |
55 | _productDal.Add(product);
56 |
57 | return new SuccessResult(Messages.ProductAdded);
58 |
59 | }
60 |
61 | [CacheAspect]//key,value //Belli bir süre yapılan istekler bellekte server de tutuluyır data base ye gitmeye gerek kalmıyor
62 | public IDataResult> GetAll()
63 | {
64 | //iş kodları yazılıyor buraya
65 | if (DateTime.Now.Hour==1)
66 | {
67 | return new ErrorDataResult>(Messages.MeintenanceTime);//sadece mesaj döndürüyoruz
68 | }
69 | return new SuccessDataResult>(_productDal.GetAll(),Messages.ProductsListed);//data ve işlem sonucunu döndürüyoruz
70 | }
71 |
72 | public IDataResult> GetAllByCategoryId(int id)
73 | {
74 | return new SuccessDataResult>(_productDal.GetAll(p=> p.CategoryId==id));
75 | }
76 |
77 | [CacheAspect]
78 | [PerformanceAspect(5)]//5 saniye
79 | public IDataResult GetById(int ProductId)
80 | {
81 | return new SuccessDataResult(_productDal.Get(p=> p.ProductId == ProductId));
82 | }
83 |
84 | public IDataResult> GetByUnitPrice(decimal min, decimal max)
85 | {
86 | return new SuccessDataResult>(_productDal.GetAll(p=> p.UnitPrice>=min && p.UnitPrice<=max));
87 | }
88 |
89 | public IDataResult> GetProductDetails()
90 | {
91 | return new SuccessDataResult>(_productDal.GetProductDetails());
92 | }
93 |
94 | [ValidationAspect(typeof(ProductValidator))]
95 | [CacheRemoveAspect("IProductService.Get")]
96 | public IResult Update(Product product)
97 | {
98 | var result = _productDal.GetAll(p => p.CategoryId == product.CategoryId).Count;
99 | if (result >= 10)
100 | {
101 | return new ErrorResult(Messages.ProductCountOfCategoryError);
102 | }
103 | throw new NotImplementedException();
104 | }
105 |
106 | //iş kuralı parçacıklarımızı private olarak yazıyoruz
107 | private IResult CheckIfProductCountOfCategoryCorrect(int categoryId)//kategorideki ürün sayısının kurallara uygunluğunu doğrula
108 | {
109 | var result = _productDal.GetAll(p => p.CategoryId == categoryId).Count;//count sayıyı ver demek yani kaç tane ürün varsa
110 | if (result >= 15)
111 | {
112 | return new ErrorResult(Messages.ProductCountOfCategoryError);
113 | }
114 | return new SuccessResult();//şu kuraldan geçti diye kullanıcıya bilgi verilmediği için burada mesaj kullanmayız
115 | }
116 | private IResult CheckIfProductNameExists(string productName)//daha önce bu ürün eklenmiş mi eklenmemiş mi
117 | {
118 | var result = _productDal.GetAll(p => p.ProductName == productName).Any();//Any Linq ten geliyor aynısı var mı demek
119 | if(result)//zaten bu result ==true demek
120 | {
121 | return new ErrorResult(Messages.ProductNameAlreadyExists);//böyle bir ürün zaten var diye mesaj gönderiyoruz
122 | }
123 | return new SuccessResult();
124 | }
125 |
126 | private IResult CheckIfCategoryLimitExceded()
127 | {
128 | var result = _categoryService.GetAll();
129 | if (result.Data.Count>15)
130 | {
131 | return new ErrorResult(Messages.CategoryLimitExceded);
132 | }
133 | return new SuccessResult();
134 | }
135 |
136 | [TransactionScopeAspect]
137 | public IResult AddTransactionalTest(Product product)//aynı anda biri hesabından para gönderiyor diğerinin hesabına para yatmıyor hata veriyor o durumda bir önceki işleme dçnmek için bu kod ları kullanırız
138 | {
139 |
140 | Add(product);
141 | if (product.UnitPrice<10)
142 | {
143 | throw new Exception("");
144 | }
145 | Add(product);
146 | return null;
147 |
148 | }
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------