Add project files.

This commit is contained in:
2025-05-01 15:18:30 +03:00
parent e058ab8015
commit 774d695414
3094 changed files with 1336814 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface ICompanyInfoDal : IGenericDal<CompanyInfo>
{
}
}

View File

@@ -0,0 +1,8 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface ICompanyInfoVideoDal : IGenericDal<CompanyInfoVideo>
{
}
}

View File

@@ -0,0 +1,11 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IContactUsDal : IGenericDal<ContactUs>
{
int CountByStatusPending();
int CountAll();
void MarkAsRead(int id);
}
}

View File

@@ -0,0 +1,9 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IFooterDal : IGenericDal<Footer>
{
Footer GetFooterDetails();
}
}

View File

@@ -0,0 +1,12 @@
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IGenericDal<T> where T : class
{
void Add(T entity);
void Delete(T entity);
void Update(T entity);
T GetByID(int id);
List<T> GetListAll();
Task<List<T>> GetListAllAsync();
}
}

View File

@@ -0,0 +1,8 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IHomeBannerDal : IGenericDal<HomeBanner>
{
}
}

View File

@@ -0,0 +1,13 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IProjectDal : IGenericDal<Project>
{
void ProjectStatusActive(int id);
void rojectStatusPassive(int id);
int CountAll();
Project GetBySlug(string slug);
Project GetProjectWithImagesBySlug(string slug);
}
}

View File

@@ -0,0 +1,9 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IProjectGalleryDal : IGenericDal<ProjectGallery>
{
List<ProjectGallery> GetImagesByProjectId(int projectId);
}
}

View File

@@ -0,0 +1,9 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IReferenceDal : IGenericDal<Reference>
{
int CountAll();
}
}

View File

@@ -0,0 +1,10 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IServiceDal : IGenericDal<Service>
{
void ServiceStatusActive(int id);
void ServiceStatusPassive(int id);
}
}

View File

@@ -0,0 +1,8 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface ISliderDal : IGenericDal<Slider>
{
}
}

View File

@@ -0,0 +1,8 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface ITeamDal : IGenericDal<Team>
{
}
}

View File

@@ -0,0 +1,11 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface ITestimonialDal : IGenericDal<Testimonial>
{
void TestimonialStatusActive(int id);
void TestimonialStatusPassive(int id);
int CountAll();
}
}

View File

@@ -0,0 +1,10 @@
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.Abstract
{
public interface IWorkProcessDal : IGenericDal<WorkProcess>
{
void ServiceStatusActive(int id);
void ServiceStatusPassive(int id);
}
}

View File

@@ -0,0 +1,385 @@
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using static ConstructorApp.EntityLayer.Entities.Project;
namespace ConstructorApp.DataAccessLayer.Concrete
{
public class ConstructorContext : IdentityDbContext<AppUser, AppRole, int>
{
public ConstructorContext(DbContextOptions<ConstructorContext> options) : base(options)
{
}
public DbSet<CompanyInfo> CompanyInfo { get; set; }
public DbSet<ContactUs> ContactUs { get; set; }
public DbSet<Footer> Footer { get; set; }
public DbSet<HomeBanner> HomeBanners { get; set; }
public DbSet<Project> Projects { get; set; }
public DbSet<ProjectGallery> ProjectGallery { get; set; }
public DbSet<Service> Services { get; set; }
public DbSet<Slider> Sliders { get; set; }
public DbSet<Team> Teams { get; set; }
public DbSet<Testimonial> Testimonials { get; set; }
public DbSet<WorkProcess> WorkProcess { get; set; }
public DbSet<CompanyInfoVideo> CompanyInfoVideo { get; set; }
public DbSet<Reference> References { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
//lokal migration
//optionsBuilder.UseSqlServer("Server=SABI\\SQLEXPRESS;initial Catalog=CONSTRUCTOR;User ID=sa;Password=13579spP!!!!;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True");
//uzak migration
optionsBuilder.UseSqlServer("Server=94.138.207.4;initial Catalog=CONSTRUCTOR;User ID=sa;Password=13579spP!!!!;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True");
//optionsBuilder.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning));
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<CompanyInfo>().HasData(
new CompanyInfo
{
CompanyInfoID = 1,
Value = "7",
Title = "YIL",
SubTitle = "2011 yılından bu yana sektörde faaliyet göstermekteyiz."
},
new CompanyInfo
{
CompanyInfoID = 2,
Value = "54",
Title = "PROJE",
SubTitle = "Bugüne kadar 54 adet konut projesi tasarladık."
},
new CompanyInfo
{
CompanyInfoID = 3,
Value = "11",
Title = "ÖDÜL",
SubTitle = "Şirketimiz yaratıcılığı nedeniyle birçok kez ödüle layık görüldü."
}
);
var hasher = new PasswordHasher<AppUser>();
modelBuilder.Entity<AppUser>().HasData(
new AppUser
{
Id = 1, // int id veya GUID
FirstName = "Admin",
LastName = "Admin",
ImageUrl = "/SeedData/defaultuser.png",
UserName = "admin",
NormalizedUserName = "ADMIN",
Email = "admin@example.com",
NormalizedEmail = "ADMIN@EXAMPLE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "Password123!"),
SecurityStamp = Guid.NewGuid().ToString("D")
}
);
modelBuilder.Entity<AppRole>().HasData(
new AppRole
{
Id = 1, // int id veya GUID
Name = "Admin",
NormalizedName = "ADMIN",
ConcurrencyStamp = Guid.NewGuid().ToString("D")
}
);
modelBuilder.Entity<IdentityUserRole<int>>().HasData(
new IdentityUserRole<int>
{
UserId = 1,
RoleId = 1
}
);
modelBuilder.Entity<CompanyInfoVideo>().HasData(
new CompanyInfoVideo
{
CompanyInfoVideoID = 1,
VideoUrl = "https://www.youtube.com/watch?v=r-thd4PJKBw"
}
);
modelBuilder.Entity<Footer>().HasData(
new Footer
{
FooterID = 1,
Phone = "0999 999 99 99",
Mail = "insaatmimarlik@mimarlik.com",
Facebook = "https://facebook.com",
Instagram = "https://instagram.com",
Linkedin = "https://linkedin.com",
Youtube = "https://youtube.com",
LogoUrl = "/SeedData/Logo.png"
}
);
modelBuilder.Entity<HomeBanner>().HasData(
new HomeBanner
{
HomeBannerID = 1,
Title = "Tasarım & İnşaat",
SubTitle = "150 m2'den başlayan modern enerji tasarruflu evler.",
LogoUrl = "/SeedData/Logo.png"
}
);
modelBuilder.Entity<Project>().HasData(
new Project
{
ProjectID = 1,
CoverUrl = "/SeedData/Project-3.png",
Date = DateOnly.Parse("2025-04-15"),
Title = "Taşevler",
Location = "3119 Mulberry Ln, Newcastle, UK",
ShortDescription = "Eski 2 katlı evi tamamen genişletip yeniden tasarlamak için üç ay boyunca bu proje üzerinde çalıştık.",
IsActive = true,
Slug = "tasevler",
LongDescription = "Autem ipsum nam porro corporis rerum. Quis eos dolorem eos itaque inventore commodi labore quia quia. Exercitationem repudiandae officiis neque suscipit non officia eaque itaque enim. Voluptatem officia accusantium nesciunt est omnis tempora consectetur dignissimos. Sequi nulla at esse enim cum deserunt eius.\r\nAmet consequatur qui dolore veniam voluptatem voluptatem sit. Non aspernatur atque natus ut cum nam et. Praesentium error dolores rerum minus sequi quia veritatis eum. Eos et doloribus doloremque nesciunt molestiae laboriosam.\r\nImpedit ipsum quae et aliquid doloribus et voluptatem quasi. Perspiciatis occaecati earum et magnam animi. Quibusdam non qui ea vitae suscipit vitae sunt. Repudiandae incidunt cumque minus deserunt assumenda tempore. Delectus voluptas necessitatibus est.\r\nSunt voluptatum sapiente facilis quo odio aut ipsum repellat debitis. Molestiae et autem libero. Explicabo et quod necessitatibus similique quis dolor eum. Numquam eaque praesentium rem et qui nesciunt.",
GoogleMapIFrame = "https://www.google.com/maps/embed?pb=!1m13!1m8!1m3!1d50122.87145390096!2d26.7044768!3d38.2637395!3m2!1i1024!2i768!4f13.1!3m2!1m1!2s!5e0!3m2!1str!2str!4v1722545102804!5m2!1str!2str",
VideoUrl = "https://www.youtube.com/watch?v=r-thd4PJKBw",
FloorPlanUrl = "/SeedData/floor-plan.png",
Status = ProjectStatus.Completed
},
new Project
{
ProjectID = 2,
CoverUrl = "/SeedData/Project-2.png",
Date = DateOnly.Parse("2026-02-15"),
Title = "Yatay Mimari",
Location = "2560 Russell st, Boston, MA",
ShortDescription = "2022 yılındaki ilk projelerimizden biri olan bu ev, benzersiz peyzaj tasarım çözümleri ve dış cephe çalışmalarıyla dikkat çekiyor.",
IsActive = true,
Slug = "yataymimari",
LongDescription = "Autem ipsum nam porro corporis rerum. Quis eos dolorem eos itaque inventore commodi labore quia quia. Exercitationem repudiandae officiis neque suscipit non officia eaque itaque enim. Voluptatem officia accusantium nesciunt est omnis tempora consectetur dignissimos. Sequi nulla at esse enim cum deserunt eius.\r\nAmet consequatur qui dolore veniam voluptatem voluptatem sit. Non aspernatur atque natus ut cum nam et. Praesentium error dolores rerum minus sequi quia veritatis eum. Eos et doloribus doloremque nesciunt molestiae laboriosam.\r\nImpedit ipsum quae et aliquid doloribus et voluptatem quasi. Perspiciatis occaecati earum et magnam animi. Quibusdam non qui ea vitae suscipit vitae sunt. Repudiandae incidunt cumque minus deserunt assumenda tempore. Delectus voluptas necessitatibus est.\r\nSunt voluptatum sapiente facilis quo odio aut ipsum repellat debitis. Molestiae et autem libero. Explicabo et quod necessitatibus similique quis dolor eum. Numquam eaque praesentium rem et qui nesciunt.",
GoogleMapIFrame = "https://www.google.com/maps/embed?pb=!1m13!1m8!1m3!1d50122.87145390096!2d26.7044768!3d38.2637395!3m2!1i1024!2i768!4f13.1!3m2!1m1!2s!5e0!3m2!1str!2str!4v1722545102804!5m2!1str!2str",
VideoUrl = "https://www.youtube.com/watch?v=r-thd4PJKBw",
FloorPlanUrl = "/SeedData/floor-plan.png",
Status = ProjectStatus.UnderConstruction
},
new Project
{
ProjectID = 3,
CoverUrl = "/SeedData/Project-1.png",
Date = DateOnly.Parse("2027-01-10"),
Title = "Modern Mimari",
Location = "123 Ave. Boston",
ShortDescription = "2022 yılındaki ilk projelerimizden biri olan bu ev, benzersiz peyzaj tasarım çözümleri ve dış cephe çalışmalarıyla dikkat çekiyor.",
IsActive = true,
Slug = "modernmimari",
LongDescription = "Autem ipsum nam porro corporis rerum. Quis eos dolorem eos itaque inventore commodi labore quia quia. Exercitationem repudiandae officiis neque suscipit non officia eaque itaque enim. Voluptatem officia accusantium nesciunt est omnis tempora consectetur dignissimos. Sequi nulla at esse enim cum deserunt eius.\r\nAmet consequatur qui dolore veniam voluptatem voluptatem sit. Non aspernatur atque natus ut cum nam et. Praesentium error dolores rerum minus sequi quia veritatis eum. Eos et doloribus doloremque nesciunt molestiae laboriosam.\r\nImpedit ipsum quae et aliquid doloribus et voluptatem quasi. Perspiciatis occaecati earum et magnam animi. Quibusdam non qui ea vitae suscipit vitae sunt. Repudiandae incidunt cumque minus deserunt assumenda tempore. Delectus voluptas necessitatibus est.\r\nSunt voluptatum sapiente facilis quo odio aut ipsum repellat debitis. Molestiae et autem libero. Explicabo et quod necessitatibus similique quis dolor eum. Numquam eaque praesentium rem et qui nesciunt.",
GoogleMapIFrame = "https://www.google.com/maps/embed?pb=!1m13!1m8!1m3!1d50122.87145390096!2d26.7044768!3d38.2637395!3m2!1i1024!2i768!4f13.1!3m2!1m1!2s!5e0!3m2!1str!2str!4v1722545102804!5m2!1str!2str",
VideoUrl = "https://www.youtube.com/watch?v=r-thd4PJKBw",
FloorPlanUrl = "/SeedData/floor-plan.png",
Status = ProjectStatus.Planned
}
);
modelBuilder.Entity<Reference>().HasData(
new Reference
{
ReferenceID = 1,
LogoUrl = "/SeedData/Reference-1.png",
WebUrl = "https://google.com"
},
new Reference
{
ReferenceID = 2,
LogoUrl = "/SeedData/Reference-2.png",
WebUrl = "https://google.com"
},
new Reference
{
ReferenceID = 3,
LogoUrl = "/SeedData/Reference-3.png",
WebUrl = "https://google.com"
},
new Reference
{
ReferenceID = 4,
LogoUrl = "/SeedData/Reference-4.png",
WebUrl = "https://google.com"
},
new Reference
{
ReferenceID = 5,
LogoUrl = "/SeedData/Reference-5.png",
WebUrl = "https://google.com"
},
new Reference
{
ReferenceID = 6,
LogoUrl = "/SeedData/Reference-6.png",
WebUrl = "https://google.com"
}
);
modelBuilder.Entity<Service>().HasData(
new Service
{
ServiceID = 1,
Title = "Mimarlık",
SubTitle = "Yüksek kalitede mimarlık hizmetleri sunuyoruz.",
IsActive = true
},
new Service
{
ServiceID = 2,
Title = "İç mekan tasarımı",
SubTitle = "Ekibimiz özgün ve şık mimari çözümler sunmaktadır.",
IsActive = true
},
new Service
{
ServiceID = 3,
Title = "Peyzaj Mimarisi",
SubTitle = "Estetik ve fonksiyonelliği bir araya getiren peyzaj çözümleri üretiyoruz.",
IsActive = true
}
);
modelBuilder.Entity<Slider>().HasData(
new Slider
{
SliderID = 1,
Location = "2750 Duffy St",
Sqm = "200",
PriceInfo = "400.000",
ImageUrl = "/SeedData/Slider-1.png"
},
new Slider
{
SliderID = 2,
Location = "5032 Hewes Ave",
Sqm = "290",
PriceInfo = "490.000",
ImageUrl = "/SeedData/Slider-2.png"
},
new Slider
{
SliderID = 3,
Location = "2239 Wilmar Farm Rd",
Sqm = "350",
PriceInfo = "550.000",
ImageUrl = "/SeedData/Slider-3.png"
}
);
modelBuilder.Entity<Team>().HasData(
new Team
{
TeamID = 1,
NameSurname = "Meryem Sağkut",
Title = "Baş İç Mimar",
ImageUrl = "/SeedData/Team-1.jpg",
Facebook = "https://facebook.com",
Instagram = "https://instagram.com",
Linkedin = "https://linkedin.com"
},
new Team
{
TeamID = 2,
NameSurname = "Can Balamir",
Title = "Kıdemli Mimar",
ImageUrl = "/SeedData/Team-2.jpg",
Facebook = "https://facebook.com",
Instagram = "https://instagram.com",
Linkedin = "https://linkedin.com"
},
new Team
{
TeamID = 3,
NameSurname = "Aslı Sönmez",
Title = "Dış Cephe ve Peyzaj Tasarımcısı",
ImageUrl = "/SeedData/Team-3.jpg",
Facebook = "https://facebook.com",
Instagram = "https://instagram.com",
Linkedin = "https://linkedin.com"
},
new Team
{
TeamID = 4,
NameSurname = "Kübra Mecan",
Title = "Proje Müdürü",
ImageUrl = "/SeedData/Team-4.jpg",
Facebook = "https://facebook.com",
Instagram = "https://instagram.com",
Linkedin = "https://linkedin.com"
}
);
modelBuilder.Entity<Testimonial>().HasData(
new Testimonial
{
TestimonialID = 1,
Name = "Samet Malkın",
Title = "Müşteri",
ImageUrl = "/SeedData/User-1.png",
Comment = "Tasarım ve mimarlık hizmeti veren birçok şirketle çalıştım ve siz bunların arasından gerçekten sıyrılan ve harika bir iş çıkaranlardan birisiniz.",
Status = TestimonialStatus.Confirmed
},
new Testimonial
{
TestimonialID = 2,
Name = "Kübra Yalman",
Title = "Girişimci",
ImageUrl = "/SeedData/User-2.png",
Comment = "Birinci sınıf yaratıcılık ve kaliteli hizmet arıyordum ve ekibinizde aradığımı buldum. Tüm fikirlerimi ve taleplerimi dikkate aldınız ve harika bir proje ortaya çıkardınız.",
Status = TestimonialStatus.Confirmed
}
);
modelBuilder.Entity<WorkProcess>().HasData(
new WorkProcess
{
WorkProcessID = 1,
Info = "Müşteri ile tanışma",
Title = "Hedefleri karşılayın ve tanımlayın",
SubTitle = "Yaptığımız ilk şey müşterilerimizle bir araya gelip gelecekteki bir projedeki hedeflerini konuşmaktır. Bu toplantı sırasında fikirlerinizi iletmekten ve bolca soru sormaktan çekinmeyin. Bu aşama oldukça belirleyicidir çünkü potansiyel mimarınızın çalışmalarını portföylerine göz atarak değerlendirebilirsiniz. Bir müşteri olarak mimarın ihtiyaçlarınızı dinleyip dinlemediğini ve bunları anlayıp anlamadığını da değerlendirebilirsiniz.",
ImageUrl = "/SeedData/WorkProcess-1.png",
IsActive = true
},
new WorkProcess
{
WorkProcessID = 2,
Info = "Proje Konsept Geliştirme",
Title = "Konsept Üzerinde Çalışma",
SubTitle = "İşbirliğimizin bir sonraki adımı, gelecekteki evinizin konseptini geliştirmektir. Evinizin inşaat sürecini başarılı kılan her bir faktörü tanımlamamıza yardımcı olur. Tasarımcı ve mimar ekibimiz, nihai sonucun yalnızca gereksinimlerinizi değil aynı zamanda uluslararası inşaat ve güvenlik standartlarını da karşılamasını sağlamak için projenin her bir adımını planlamalıdır. İzleme ve kontrol bu noktada başlar.",
ImageUrl = "/SeedData/WorkProcess-2.png",
IsActive = true
},
new WorkProcess
{
WorkProcessID = 3,
Info = "İç ve Dış Mekanda Çalışma",
Title = "Evinizi İnşa Etme",
SubTitle = "Bir ev inşa etmenin en önemli ve sorumlu kısmının inşaat süreci olduğuna şüphe yok. Güvenilir müteahhitlerle çalıştığımız için harika bir sonuç garantilidir. Bu aşama, inşaat alanını hazırlamaktan izolasyonu kurmaya ve alçıpanı tamamlamaya ve dış cephede çalışmaya kadar kontrol edilmesi gereken çeşitli görevleri içerdiğinden en karmaşık olanlardan biridir.",
ImageUrl = "/SeedData/WorkProcess-3.png",
IsActive = true
},
new WorkProcess
{
WorkProcessID = 4,
Info = "Gelecekteki eviniz için son rötuşlar",
Title = "Projenin Tamamlanması",
SubTitle = "Proje son aşamasına geldiğinde, kalite kontrol ekibimiz her şeyin doğru şekilde yapıldığından emin olmak için binanın son kontrolünü gerçekleştirir. Çalışanlarımız ayrıca bu son adımda tüm iç elemanların ve armatürlerin doğru şekilde monte edildiğinden emin olacaktır. Her şey tamamlandıktan sonra, müşterimizi nihai sonucu değerlendirmeye ve projemizin kaliteli performansını deneyimlemeye davet ediyoruz.",
ImageUrl = "/SeedData/WorkProcess-4.png",
IsActive = true
}
);
}
}
}

View File

@@ -0,0 +1,16 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace ConstructorApp.DataAccessLayer.Concrete
{
public class ConstructorContextFactory : IDesignTimeDbContextFactory<ConstructorContext>
{
public ConstructorContext CreateDbContext(string[] args)
{
var optionsBuilder = new DbContextOptionsBuilder<ConstructorContext>();
optionsBuilder.UseSqlServer("Server=SABI\\SQLEXPRESS;Initial Catalog=CONSTRUCTOR;User ID=sa;Password=13579spP!!!!;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True");
return new ConstructorContext(optionsBuilder.Options);
}
}
}

View File

@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ConstructorApp.EntityLayer\ConstructorApp.EntityLayer.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfCompanyInfoDal : GenericRepository<CompanyInfo>, ICompanyInfoDal
{
public EfCompanyInfoDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfCompanyInfoVideoDal : GenericRepository<CompanyInfoVideo>, ICompanyInfoVideoDal
{
public EfCompanyInfoVideoDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,34 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfContactUsDal : GenericRepository<ContactUs>, IContactUsDal
{
private readonly ConstructorContext context;
public EfContactUsDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.ContactUs.Count();
}
public int CountByStatusPending()
{
return context.ContactUs.Where(x => x.Status == false).Count();
}
public void MarkAsRead(int id)
{
var values = context.ContactUs.Find(id);
values.Status = true;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,21 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfFooterDal : GenericRepository<Footer>, IFooterDal
{
private readonly ConstructorContext _context;
public EfFooterDal(ConstructorContext context) : base(context)
{
_context = context;
}
public Footer GetFooterDetails()
{
return _context.Footer.FirstOrDefault();
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfHomeBannerDal : GenericRepository<HomeBanner>, IHomeBannerDal
{
public EfHomeBannerDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,48 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.EntityFrameworkCore;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfProjectDal : GenericRepository<Project>, IProjectDal
{
private readonly ConstructorContext context;
public EfProjectDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.Projects.Count(x => x.IsActive == true);
}
public Project GetBySlug(string slug)
{
return context.Projects.FirstOrDefault(p => p.Slug == slug && p.IsActive);
}
public Project GetProjectWithImagesBySlug(string slug)
{
return context.Projects
.Include(p => p.ProjectGallery)
.FirstOrDefault(p => p.Slug == slug);
}
public void ProjectStatusActive(int id)
{
var values = context.Projects.Find(id);
values.IsActive = true;
context.SaveChanges();
}
public void rojectStatusPassive(int id)
{
var values = context.Projects.Find(id);
values.IsActive = false;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,23 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfProjectGalleryDal : GenericRepository<ProjectGallery>, IProjectGalleryDal
{
private readonly ConstructorContext context;
public EfProjectGalleryDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public List<ProjectGallery> GetImagesByProjectId(int projectId)
{
return context.ProjectGallery
.Where(x => x.ProjectID == projectId)
.ToList();
}
}
}

View File

@@ -0,0 +1,21 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfReferenceDal : GenericRepository<Reference>, IReferenceDal
{
private readonly ConstructorContext context;
public EfReferenceDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.References.Count();
}
}
}

View File

@@ -0,0 +1,30 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfServiceDal : GenericRepository<Service>, IServiceDal
{
private readonly ConstructorContext context;
public EfServiceDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public void ServiceStatusActive(int id)
{
var values = context.Services.Find(id);
values.IsActive = true;
context.SaveChanges();
}
public void ServiceStatusPassive(int id)
{
var values = context.Services.Find(id);
values.IsActive = false;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfSliderDal : GenericRepository<Slider>, ISliderDal
{
public EfSliderDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfTeamDal : GenericRepository<Team>, ITeamDal
{
public EfTeamDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,35 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfTestimonialDal : GenericRepository<Testimonial>, ITestimonialDal
{
private readonly ConstructorContext context;
public EfTestimonialDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.Testimonials.Count(x => x.Status != TestimonialStatus.Cancelled);
}
public void TestimonialStatusActive(int id)
{
var values = context.Testimonials.Find(id);
values.Status = TestimonialStatus.Confirmed;
context.SaveChanges();
}
public void TestimonialStatusPassive(int id)
{
var values = context.Testimonials.Find(id);
values.Status = TestimonialStatus.Cancelled;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,30 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfWorkProcessDal : GenericRepository<WorkProcess>, IWorkProcessDal
{
private readonly ConstructorContext context;
public EfWorkProcessDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public void ServiceStatusActive(int id)
{
var values = context.WorkProcess.Find(id);
values.IsActive = true;
context.SaveChanges();
}
public void ServiceStatusPassive(int id)
{
var values = context.WorkProcess.Find(id);
values.IsActive = false;
context.SaveChanges();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,611 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace ConstructorApp.DataAccessLayer.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FirstName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
LastName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ImageUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ConfirmCode = table.Column<int>(type: "int", nullable: false),
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
AccessFailedCount = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CompanyInfo",
columns: table => new
{
CompanyInfoID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Value = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: false),
Title = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
SubTitle = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CompanyInfo", x => x.CompanyInfoID);
});
migrationBuilder.CreateTable(
name: "CompanyInfoVideo",
columns: table => new
{
CompanyInfoVideoID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
VideoUrl = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CompanyInfoVideo", x => x.CompanyInfoVideoID);
});
migrationBuilder.CreateTable(
name: "ContactUs",
columns: table => new
{
ContactusID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
NameSurname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Mail = table.Column<string>(type: "nvarchar(max)", nullable: false),
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
MessageContent = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
Status = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ContactUs", x => x.ContactusID);
});
migrationBuilder.CreateTable(
name: "Footer",
columns: table => new
{
FooterID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LogoUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Phone = table.Column<string>(type: "nvarchar(14)", maxLength: 14, nullable: true),
Mail = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Facebook = table.Column<string>(type: "nvarchar(max)", nullable: true),
Instagram = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Linkedin = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Youtube = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Footer", x => x.FooterID);
});
migrationBuilder.CreateTable(
name: "HomeBanners",
columns: table => new
{
HomeBannerID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Title = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
SubTitle = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
LogoUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HomeBanners", x => x.HomeBannerID);
});
migrationBuilder.CreateTable(
name: "Projects",
columns: table => new
{
ProjectID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CoverUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Date = table.Column<DateOnly>(type: "date", nullable: false),
Title = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Location = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ShortDescription = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
LongDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false),
Slug = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
GoogleMapIFrame = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
VideoUrl = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
FloorPlanUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Status = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Projects", x => x.ProjectID);
});
migrationBuilder.CreateTable(
name: "References",
columns: table => new
{
ReferenceID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LogoUrl = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
WebUrl = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_References", x => x.ReferenceID);
});
migrationBuilder.CreateTable(
name: "Services",
columns: table => new
{
ServiceID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Title = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
SubTitle = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
IsActive = table.Column<bool>(type: "bit", maxLength: 100, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Services", x => x.ServiceID);
});
migrationBuilder.CreateTable(
name: "Sliders",
columns: table => new
{
SliderID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Location = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Sqm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
PriceInfo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ImageUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Sliders", x => x.SliderID);
});
migrationBuilder.CreateTable(
name: "Teams",
columns: table => new
{
TeamID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
NameSurname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Title = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
ImageUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Facebook = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Instagram = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Linkedin = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Teams", x => x.TeamID);
});
migrationBuilder.CreateTable(
name: "Testimonials",
columns: table => new
{
TestimonialID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Title = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Comment = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
ImageUrl = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Status = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Testimonials", x => x.TestimonialID);
});
migrationBuilder.CreateTable(
name: "WorkProcess",
columns: table => new
{
WorkProcessID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Info = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Title = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
SubTitle = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
ImageUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WorkProcess", x => x.WorkProcessID);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RoleId = table.Column<int>(type: "int", nullable: false),
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<int>(type: "int", nullable: false),
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
UserId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<int>(type: "int", nullable: false),
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ProjectGallery",
columns: table => new
{
ProjectGalleryID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ImageUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ProjectID = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectGallery", x => x.ProjectGalleryID);
table.ForeignKey(
name: "FK_ProjectGallery_Projects_ProjectID",
column: x => x.ProjectID,
principalTable: "Projects",
principalColumn: "ProjectID",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[] { 1, "3abf73f8-a18f-4452-9c3f-d8abf48c18c5", "Admin", "ADMIN" });
migrationBuilder.InsertData(
table: "AspNetUsers",
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "ConfirmCode", "Email", "EmailConfirmed", "FirstName", "ImageUrl", "LastName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
values: new object[] { 1, 0, "b899157c-b38b-43f9-8fdf-f04d21a0370c", 0, "admin@example.com", true, "Admin", "/SeedData/defaultuser.png", "Admin", false, null, "ADMIN@EXAMPLE.COM", "ADMIN", "AQAAAAIAAYagAAAAEDNJ/hC+Ey7MpD2q6eaGnJn6CQmUyNUgiZiUCdHqiAhGJsnhm+Q3VY+xhEZALFzeOA==", null, false, "6d0581e4-af84-4438-aa89-17362a9302f4", false, "admin" });
migrationBuilder.InsertData(
table: "CompanyInfo",
columns: new[] { "CompanyInfoID", "SubTitle", "Title", "Value" },
values: new object[,]
{
{ 1, "2011 yılından bu yana sektörde faaliyet göstermekteyiz.", "YIL", "7" },
{ 2, "Bugüne kadar 54 adet konut projesi tasarladık.", "PROJE", "54" },
{ 3, "Şirketimiz yaratıcılığı nedeniyle birçok kez ödüle layık görüldü.", "ÖDÜL", "11" }
});
migrationBuilder.InsertData(
table: "CompanyInfoVideo",
columns: new[] { "CompanyInfoVideoID", "VideoUrl" },
values: new object[] { 1, "https://www.youtube.com/watch?v=r-thd4PJKBw" });
migrationBuilder.InsertData(
table: "Footer",
columns: new[] { "FooterID", "Facebook", "Instagram", "Linkedin", "LogoUrl", "Mail", "Phone", "Youtube" },
values: new object[] { 1, "https://facebook.com", "https://instagram.com", "https://linkedin.com", "/SeedData/Logo.png", "insaatmimarlik@mimarlik.com", "0999 999 99 99", "https://youtube.com" });
migrationBuilder.InsertData(
table: "HomeBanners",
columns: new[] { "HomeBannerID", "LogoUrl", "SubTitle", "Title" },
values: new object[] { 1, "/SeedData/Logo.png", "150 m2'den başlayan modern enerji tasarruflu evler.", "Tasarım & İnşaat" });
migrationBuilder.InsertData(
table: "Projects",
columns: new[] { "ProjectID", "CoverUrl", "Date", "FloorPlanUrl", "GoogleMapIFrame", "IsActive", "Location", "LongDescription", "ShortDescription", "Slug", "Status", "Title", "VideoUrl" },
values: new object[,]
{
{ 1, "/SeedData/Project-3.png", new DateOnly(2025, 4, 15), "/SeedData/floor-plan.png", "https://www.google.com/maps/embed?pb=!1m13!1m8!1m3!1d50122.87145390096!2d26.7044768!3d38.2637395!3m2!1i1024!2i768!4f13.1!3m2!1m1!2s!5e0!3m2!1str!2str!4v1722545102804!5m2!1str!2str", true, "3119 Mulberry Ln, Newcastle, UK", "Autem ipsum nam porro corporis rerum. Quis eos dolorem eos itaque inventore commodi labore quia quia. Exercitationem repudiandae officiis neque suscipit non officia eaque itaque enim. Voluptatem officia accusantium nesciunt est omnis tempora consectetur dignissimos. Sequi nulla at esse enim cum deserunt eius.\r\nAmet consequatur qui dolore veniam voluptatem voluptatem sit. Non aspernatur atque natus ut cum nam et. Praesentium error dolores rerum minus sequi quia veritatis eum. Eos et doloribus doloremque nesciunt molestiae laboriosam.\r\nImpedit ipsum quae et aliquid doloribus et voluptatem quasi. Perspiciatis occaecati earum et magnam animi. Quibusdam non qui ea vitae suscipit vitae sunt. Repudiandae incidunt cumque minus deserunt assumenda tempore. Delectus voluptas necessitatibus est.\r\nSunt voluptatum sapiente facilis quo odio aut ipsum repellat debitis. Molestiae et autem libero. Explicabo et quod necessitatibus similique quis dolor eum. Numquam eaque praesentium rem et qui nesciunt.", "Eski 2 katlı evi tamamen genişletip yeniden tasarlamak için üç ay boyunca bu proje üzerinde çalıştık.", "tasevler", 2, "Taşevler", "https://www.youtube.com/watch?v=r-thd4PJKBw" },
{ 2, "/SeedData/Project-2.png", new DateOnly(2026, 2, 15), "/SeedData/floor-plan.png", "https://www.google.com/maps/embed?pb=!1m13!1m8!1m3!1d50122.87145390096!2d26.7044768!3d38.2637395!3m2!1i1024!2i768!4f13.1!3m2!1m1!2s!5e0!3m2!1str!2str!4v1722545102804!5m2!1str!2str", true, "2560 Russell st, Boston, MA", "Autem ipsum nam porro corporis rerum. Quis eos dolorem eos itaque inventore commodi labore quia quia. Exercitationem repudiandae officiis neque suscipit non officia eaque itaque enim. Voluptatem officia accusantium nesciunt est omnis tempora consectetur dignissimos. Sequi nulla at esse enim cum deserunt eius.\r\nAmet consequatur qui dolore veniam voluptatem voluptatem sit. Non aspernatur atque natus ut cum nam et. Praesentium error dolores rerum minus sequi quia veritatis eum. Eos et doloribus doloremque nesciunt molestiae laboriosam.\r\nImpedit ipsum quae et aliquid doloribus et voluptatem quasi. Perspiciatis occaecati earum et magnam animi. Quibusdam non qui ea vitae suscipit vitae sunt. Repudiandae incidunt cumque minus deserunt assumenda tempore. Delectus voluptas necessitatibus est.\r\nSunt voluptatum sapiente facilis quo odio aut ipsum repellat debitis. Molestiae et autem libero. Explicabo et quod necessitatibus similique quis dolor eum. Numquam eaque praesentium rem et qui nesciunt.", "2022 yılındaki ilk projelerimizden biri olan bu ev, benzersiz peyzaj tasarım çözümleri ve dış cephe çalışmalarıyla dikkat çekiyor.", "yataymimari", 1, "Yatay Mimari", "https://www.youtube.com/watch?v=r-thd4PJKBw" },
{ 3, "/SeedData/Project-1.png", new DateOnly(2027, 1, 10), "/SeedData/floor-plan.png", "https://www.google.com/maps/embed?pb=!1m13!1m8!1m3!1d50122.87145390096!2d26.7044768!3d38.2637395!3m2!1i1024!2i768!4f13.1!3m2!1m1!2s!5e0!3m2!1str!2str!4v1722545102804!5m2!1str!2str", true, "123 Ave. Boston", "Autem ipsum nam porro corporis rerum. Quis eos dolorem eos itaque inventore commodi labore quia quia. Exercitationem repudiandae officiis neque suscipit non officia eaque itaque enim. Voluptatem officia accusantium nesciunt est omnis tempora consectetur dignissimos. Sequi nulla at esse enim cum deserunt eius.\r\nAmet consequatur qui dolore veniam voluptatem voluptatem sit. Non aspernatur atque natus ut cum nam et. Praesentium error dolores rerum minus sequi quia veritatis eum. Eos et doloribus doloremque nesciunt molestiae laboriosam.\r\nImpedit ipsum quae et aliquid doloribus et voluptatem quasi. Perspiciatis occaecati earum et magnam animi. Quibusdam non qui ea vitae suscipit vitae sunt. Repudiandae incidunt cumque minus deserunt assumenda tempore. Delectus voluptas necessitatibus est.\r\nSunt voluptatum sapiente facilis quo odio aut ipsum repellat debitis. Molestiae et autem libero. Explicabo et quod necessitatibus similique quis dolor eum. Numquam eaque praesentium rem et qui nesciunt.", "2022 yılındaki ilk projelerimizden biri olan bu ev, benzersiz peyzaj tasarım çözümleri ve dış cephe çalışmalarıyla dikkat çekiyor.", "modernmimari", 0, "Modern Mimari", "https://www.youtube.com/watch?v=r-thd4PJKBw" }
});
migrationBuilder.InsertData(
table: "References",
columns: new[] { "ReferenceID", "LogoUrl", "WebUrl" },
values: new object[,]
{
{ 1, "/SeedData/Reference-1.png", "https://google.com" },
{ 2, "/SeedData/Reference-2.png", "https://google.com" },
{ 3, "/SeedData/Reference-3.png", "https://google.com" },
{ 4, "/SeedData/Reference-4.png", "https://google.com" },
{ 5, "/SeedData/Reference-5.png", "https://google.com" },
{ 6, "/SeedData/Reference-6.png", "https://google.com" }
});
migrationBuilder.InsertData(
table: "Services",
columns: new[] { "ServiceID", "IsActive", "SubTitle", "Title" },
values: new object[,]
{
{ 1, true, "Yüksek kalitede mimarlık hizmetleri sunuyoruz.", "Mimarlık" },
{ 2, true, "Ekibimiz özgün ve şık mimari çözümler sunmaktadır.", "İç mekan tasarımı" },
{ 3, true, "Estetik ve fonksiyonelliği bir araya getiren peyzaj çözümleri üretiyoruz.", "Peyzaj Mimarisi" }
});
migrationBuilder.InsertData(
table: "Sliders",
columns: new[] { "SliderID", "ImageUrl", "Location", "PriceInfo", "Sqm" },
values: new object[,]
{
{ 1, "/SeedData/Slider-1.png", "2750 Duffy St", "400.000", "200" },
{ 2, "/SeedData/Slider-2.png", "5032 Hewes Ave", "490.000", "290" },
{ 3, "/SeedData/Slider-3.png", "2239 Wilmar Farm Rd", "550.000", "350" }
});
migrationBuilder.InsertData(
table: "Teams",
columns: new[] { "TeamID", "Facebook", "ImageUrl", "Instagram", "Linkedin", "NameSurname", "Title" },
values: new object[,]
{
{ 1, "https://facebook.com", "/SeedData/Team-1.jpg", "https://instagram.com", "https://linkedin.com", "Meryem Sağkut", "Baş İç Mimar" },
{ 2, "https://facebook.com", "/SeedData/Team-2.jpg", "https://instagram.com", "https://linkedin.com", "Can Balamir", "Kıdemli Mimar" },
{ 3, "https://facebook.com", "/SeedData/Team-3.jpg", "https://instagram.com", "https://linkedin.com", "Aslı Sönmez", "Dış Cephe ve Peyzaj Tasarımcısı" },
{ 4, "https://facebook.com", "/SeedData/Team-4.jpg", "https://instagram.com", "https://linkedin.com", "Kübra Mecan", "Proje Müdürü" }
});
migrationBuilder.InsertData(
table: "Testimonials",
columns: new[] { "TestimonialID", "Comment", "ImageUrl", "Name", "Status", "Title" },
values: new object[,]
{
{ 1, "Tasarım ve mimarlık hizmeti veren birçok şirketle çalıştım ve siz bunların arasından gerçekten sıyrılan ve harika bir iş çıkaranlardan birisiniz.", "/SeedData/User-1.png", "Samet Malkın", 1, "Müşteri" },
{ 2, "Birinci sınıf yaratıcılık ve kaliteli hizmet arıyordum ve ekibinizde aradığımı buldum. Tüm fikirlerimi ve taleplerimi dikkate aldınız ve harika bir proje ortaya çıkardınız.", "/SeedData/User-2.png", "Kübra Yalman", 1, "Girişimci" }
});
migrationBuilder.InsertData(
table: "WorkProcess",
columns: new[] { "WorkProcessID", "ImageUrl", "Info", "IsActive", "SubTitle", "Title" },
values: new object[,]
{
{ 1, "/SeedData/WorkProcess-1.png", "Müşteri ile tanışma", true, "Yaptığımız ilk şey müşterilerimizle bir araya gelip gelecekteki bir projedeki hedeflerini konuşmaktır. Bu toplantı sırasında fikirlerinizi iletmekten ve bolca soru sormaktan çekinmeyin. Bu aşama oldukça belirleyicidir çünkü potansiyel mimarınızın çalışmalarını portföylerine göz atarak değerlendirebilirsiniz. Bir müşteri olarak mimarın ihtiyaçlarınızı dinleyip dinlemediğini ve bunları anlayıp anlamadığını da değerlendirebilirsiniz.", "Hedefleri karşılayın ve tanımlayın" },
{ 2, "/SeedData/WorkProcess-2.png", "Proje Konsept Geliştirme", true, "İşbirliğimizin bir sonraki adımı, gelecekteki evinizin konseptini geliştirmektir. Evinizin inşaat sürecini başarılı kılan her bir faktörü tanımlamamıza yardımcı olur. Tasarımcı ve mimar ekibimiz, nihai sonucun yalnızca gereksinimlerinizi değil aynı zamanda uluslararası inşaat ve güvenlik standartlarını da karşılamasını sağlamak için projenin her bir adımını planlamalıdır. İzleme ve kontrol bu noktada başlar.", "Konsept Üzerinde Çalışma" },
{ 3, "/SeedData/WorkProcess-3.png", "İç ve Dış Mekanda Çalışma", true, "Bir ev inşa etmenin en önemli ve sorumlu kısmının inşaat süreci olduğuna şüphe yok. Güvenilir müteahhitlerle çalıştığımız için harika bir sonuç garantilidir. Bu aşama, inşaat alanını hazırlamaktan izolasyonu kurmaya ve alçıpanı tamamlamaya ve dış cephede çalışmaya kadar kontrol edilmesi gereken çeşitli görevleri içerdiğinden en karmaşık olanlardan biridir.", "Evinizi İnşa Etme" },
{ 4, "/SeedData/WorkProcess-4.png", "Gelecekteki eviniz için son rötuşlar", true, "Proje son aşamasına geldiğinde, kalite kontrol ekibimiz her şeyin doğru şekilde yapıldığından emin olmak için binanın son kontrolünü gerçekleştirir. Çalışanlarımız ayrıca bu son adımda tüm iç elemanların ve armatürlerin doğru şekilde monte edildiğinden emin olacaktır. Her şey tamamlandıktan sonra, müşterimizi nihai sonucu değerlendirmeye ve projemizin kaliteli performansını deneyimlemeye davet ediyoruz.", "Projenin Tamamlanması" }
});
migrationBuilder.InsertData(
table: "AspNetUserRoles",
columns: new[] { "RoleId", "UserId" },
values: new object[] { 1, 1 });
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true,
filter: "[NormalizedName] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true,
filter: "[NormalizedUserName] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_ProjectGallery_ProjectID",
table: "ProjectGallery",
column: "ProjectID");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "CompanyInfo");
migrationBuilder.DropTable(
name: "CompanyInfoVideo");
migrationBuilder.DropTable(
name: "ContactUs");
migrationBuilder.DropTable(
name: "Footer");
migrationBuilder.DropTable(
name: "HomeBanners");
migrationBuilder.DropTable(
name: "ProjectGallery");
migrationBuilder.DropTable(
name: "References");
migrationBuilder.DropTable(
name: "Services");
migrationBuilder.DropTable(
name: "Sliders");
migrationBuilder.DropTable(
name: "Teams");
migrationBuilder.DropTable(
name: "Testimonials");
migrationBuilder.DropTable(
name: "WorkProcess");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
migrationBuilder.DropTable(
name: "Projects");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,49 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using Microsoft.EntityFrameworkCore;
namespace ConstructorApp.DataAccessLayer.Repositories
{
public class GenericRepository<T> : IGenericDal<T> where T : class
{
private readonly ConstructorContext _context;
public GenericRepository(ConstructorContext context)
{
_context = context;
}
public void Add(T entity)
{
_context.Add(entity);
_context.SaveChanges();
}
public void Delete(T entity)
{
_context.Remove(entity);
_context.SaveChanges();
}
public T GetByID(int id)
{
return _context.Set<T>().Find(id);
}
public List<T> GetListAll()
{
return _context.Set<T>().ToList();
}
public async Task<List<T>> GetListAllAsync()
{
return await _context.Set<T>().ToListAsync();
}
public void Update(T entity)
{
_context.Update(entity);
_context.SaveChanges();
}
}
}