Esempio n. 1
0
        public Model.Users Register(UserVM request, string password)
        {
            //byte[] passwordHash, passwordSalt;
            //var user = _mapper.Map<Database.Users>(req);

            //CreatePasswordHash(password, out passwordHash, out passwordSalt);

            //user.PasswordHash = passwordHash;
            //user.PasswordSalt = passwordSalt;

            // _context.Users.Add(user);
            // _context.SaveChanges();


            var entity = _mapper.Map <Users>(request);

            if (request.Password != request.PasswordConfirm)
            {
                throw new Exception("Password and password confirm not matched !");
            }
            entity.PasswordSalt = HashGenerator.GenerateSalt();
            entity.PasswordHash = HashGenerator.GenerateHash(entity.PasswordSalt, request.Password);

            _context.Add(entity);
            _context.SaveChanges();

            return(_mapper.Map <Model.Users>(entity));
        }
Esempio n. 2
0
        public Data.Model.User Update(int Id, UserUpsertRequest request)
        {
            var entity = _context.User.Find(Id);

            _context.User.Attach(entity);
            _context.User.Update(entity);

            if (request.Password != request.PasswordConfirm)
            {
                throw new Exception("Password and password confirm not matched");
            }

            if (request.Password != null)
            {
                entity.PasswordSalt = HashGenerator.GenerateSalt();
                entity.PasswordHash = HashGenerator.GenerateHash(entity.PasswordSalt, request.Password);
            }
            else
            {
                _mapper.Map(request, entity);
            }

            _context.SaveChanges();

            return(_mapper.Map <Data.Model.User>(entity));
        }
Esempio n. 3
0
        public eDentalClinic.Model.User Insert(UserInsertRequest request)
        {
            if (request.Password != request.ConfirmPassword)
            {
                throw new UserException("Password and password confirm do not match!");
            }
            var entity = _mapper.Map <Database.User>(request);

            entity.PasswordSalt = HashGenerator.GenerateSalt();
            entity.PasswordHash = HashGenerator.GenerateHash(entity.PasswordSalt, request.Password);
            _context.Users.Add(entity);
            _context.SaveChanges();

            return(_mapper.Map <eDentalClinic.Model.User>(entity));
        }
        public Model.Users Register(Model.Users request)
        {
            if (request.Password != request.PassworConfirm)
            {
                throw new Exception("Passwords don't match");
            }
            Database.Users user = _mapper.Map <Database.Users>(request);

            user.PasswordSalt = HashGenerator.GenerateSalt();
            user.PasswordHash = HashGenerator.GenerateHash(user.PasswordSalt, request.Password);

            _context.Users.Add(user);
            _context.SaveChanges();

            return(_mapper.Map <Model.Users>(user));
        }
        public Data.Customer Insert(CustomerUpsert customer)
        {
            var entity = _mapper.Map <Customer>(customer);

            if (customer.Password != customer.PasswordConfirm)
            {
                throw new Exception("Password and password confirm don't match !");
            }

            entity.PasswordSalt = HashGenerator.GenerateSalt();
            entity.PasswordHash = HashGenerator.GenerateHash(entity.PasswordSalt, customer.Password);

            _context.Add(entity);
            _context.SaveChanges();
            return(_mapper.Map <Data.Customer>(entity));
        }
        public Data.Model.Customer Insert(CustomerUpsert request)
        {
            var entity = _mapper.Map <Customer>(request);

            if (request.Password != request.PasswordConfirm)
            {
                throw new Exception("Password and password confirm not matched !");
            }
            entity.PasswordSalt = HashGenerator.GenerateSalt();
            entity.PasswordHash = HashGenerator.GenerateHash(entity.PasswordSalt, request.Password);

            _context.Add(entity);
            _context.SaveChanges();

            return(_mapper.Map <Data.Model.Customer>(entity));
        }
Esempio n. 7
0
        public Model.User AddUser(AddUserRequest req)
        {
            var validate = _context.Users.FirstOrDefault(w => w.Username == req.Username);

            if (validate != null)
            {
                return(null);
            }
            var user = _mapper.Map <Database.User>(req);

            user.PasswordSalt = HashGenerator.GenerateSalt();
            user.PasswordHash = HashGenerator.GenerateHash(user.PasswordSalt, req.Password);
            user.RoleId       = req.RoleId;
            user.CityId       = req.CityId;
            _context.Users.Add(user);
            _context.SaveChanges();
            return(_mapper.Map <Model.User>(user));
        }
Esempio n. 8
0
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            // Gender
            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderId   = 1,
                GenderType = "Female"
            });

            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderId   = 2,
                GenderType = "Male"
            });

            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderId   = 3,
                GenderType = "I don't want to say"
            });

            //UserType
            modelBuilder.Entity <UserType>().HasData(new UserType()
            {
                UserTypeId = 1,
                TypeName   = "Administrator"
            });

            modelBuilder.Entity <UserType>().HasData(new UserType()
            {
                UserTypeId = 2,
                TypeName   = "User"
            });

            //Country
            modelBuilder.Entity <Country>().HasData(new Country()
            {
                CountryId   = 1,
                CountryName = "Bosnia and Herzegovina"
            });

            modelBuilder.Entity <Country>().HasData(new Country()
            {
                CountryId   = 2,
                CountryName = "Croatia"
            });

            modelBuilder.Entity <Country>().HasData(new Country()
            {
                CountryId   = 3,
                CountryName = "Austria"
            });

            modelBuilder.Entity <Country>().HasData(new Country()
            {
                CountryId   = 4,
                CountryName = "Germany"
            });

            // City
            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 1,
                CityName  = "Sarajevo",
                ZipCode   = "71000",
                CountryId = 1
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 2,
                CityName  = "Mostar",
                ZipCode   = "88000",
                CountryId = 1
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 3,
                CityName  = "Bugojno",
                ZipCode   = "7230",
                CountryId = 1
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 4,
                CityName  = "Sarajevo",
                ZipCode   = "71000",
                CountryId = 1
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 5,
                CityName  = "Zagreb",
                ZipCode   = "10000 ",
                CountryId = 2
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 6,
                CityName  = "Graz",
                ZipCode   = "8010 ",
                CountryId = 3
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId    = 7,
                CityName  = "Munchen",
                ZipCode   = "80331",
                CountryId = 4
            });

            //Users

            //  ADMIN
            Users user = new Users
            {
                UserId      = 1,
                FirstName   = "Admin",
                LastName    = "Admin",
                Phone       = "06211111",
                Email       = "admin@hotmail",
                Adress      = "Test adress",
                YearOfBirth = new DateTime(2020, 11, 10),
                CityId      = 1,
                GenderId    = 1,
                UserTypeId  = 1
            };

            user.PasswordSalt = HashGenerator.GenerateSalt();
            user.PasswordHash = HashGenerator.GenerateHash(user.PasswordSalt, "test");

            //USER

            Users b = new Users
            {
                UserId      = 1,
                FirstName   = "User",
                LastName    = "User",
                Phone       = "061333333",
                Email       = "user@hotmail",
                Adress      = "User adress",
                YearOfBirth = new DateTime(2020, 11, 10),
                CityId      = 2,
                GenderId    = 2,
                UserTypeId  = 2
            };

            b.PasswordSalt = HashGenerator.GenerateSalt();
            b.PasswordHash = HashGenerator.GenerateHash(b.PasswordSalt, "test");

            //JobLevel

            modelBuilder.Entity <JobLevel>().HasData(new JobLevel()
            {
                JobLevelId = 1,
                LevelName  = "Junior"
            });

            modelBuilder.Entity <JobLevel>().HasData(new JobLevel()
            {
                JobLevelId = 2,
                LevelName  = "Medior"
            });

            modelBuilder.Entity <JobLevel>().HasData(new JobLevel()
            {
                JobLevelId = 3,
                LevelName  = "Senior"
            });

            // JobType
            modelBuilder.Entity <JobType>().HasData(new JobType()
            {
                JobTypeId   = 1,
                JobTypeName = "Intern"
            });

            modelBuilder.Entity <JobType>().HasData(new JobType()
            {
                JobTypeId   = 2,
                JobTypeName = "Part-time"
            });

            modelBuilder.Entity <JobType>().HasData(new JobType()
            {
                JobTypeId   = 3,
                JobTypeName = "Full-time"
            });

            //Category
            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 1,
                CategoryName = "Software developer"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 2,
                CategoryName = "Project Manager"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 3,
                CategoryName = "Solutin Architect"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 4,
                CategoryName = "Scrum Master"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 5,
                CategoryName = "UX/UI Designer"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 6,
                CategoryName = "Frontend Developer"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 7,
                CategoryName = "Backend Developer"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 8,
                CategoryName = "Database Developer"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 9,
                CategoryName = "Fullstack Developer"
            });

            modelBuilder.Entity <Category>().HasData(new Category()
            {
                CategoryId   = 10,
                CategoryName = "CTO"
            });

            // COMPANY


            //modelBuilder.Entity<Company>().HasData(new Company()
            //{
            //    CompanyId = 1,
            //    CompanyName= "Klika",
            //    Phone = "055 111",
            //    Adress = "Marsala Tita",
            //    AboutUs = "Very nice company",
            //    Photo = "",
            //    Email="test",
            //    Url= "https://klika.ba/"
            //});

            //modelBuilder.Entity<Company>().HasData(new Company()
            //{
            //    CompanyId = 2,
            //    CompanyName = "MOP",
            //    Phone = "055 222",
            //    Adress = "Franca Lehara",
            //    AboutUs = "Very nice company",
            //    Email= "test",
            //    Photo = "",
            //    Url = "https://ministryofprogramming.com/"
            //});

            //modelBuilder.Entity<Company>().HasData(new Company()
            //{
            //    CompanyId = 3,
            //    CompanyName = "Evona",
            //    Phone = "055 333",
            //    Adress = "Blajburska ulica bb",
            //    AboutUs = "Very nice company",
            //    Photo = "",
            //    Email = "test",
            //    Url = "https://www.evona.sk/"
            //});

            //modelBuilder.Entity<Company>().HasData(new Company()
            //{
            //    CompanyId = 4,
            //    CompanyName = "Mistral",
            //    Phone = "055 444",
            //    Adress = "Skenderija",
            //    AboutUs = "Very nice company",
            //    Email="",
            //    Photo = "",
            //    Url = "https://www.mistral.ba/"
            //});

            //modelBuilder.Entity<Company>().HasData(new Company()
            //{
            //    CompanyId = 5,
            //    CompanyName = "QSS",
            //    Phone = "055 555",
            //    Adress = "Skenderija",
            //    AboutUs = "Very nice company",
            //    Email= "test",
            //    Photo = "",
            //    Url = "https://www.qss.ba/"
            //});

            // Skill

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 1,
                SkillName = "OOP"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 2,
                SkillName = ".NET Core"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 3,
                SkillName = "Angular"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 4,
                SkillName = "C++"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 5,
                SkillName = "C#"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 6,
                SkillName = "Java"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 7,
                SkillName = "IoT"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 8,
                SkillName = "Azure"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 9,
                SkillName = "Docker"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 10,
                SkillName = "HTML"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 11,
                SkillName = "CSS"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 12,
                SkillName = "Java Script"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 13,
                SkillName = "REST API"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 14,
                SkillName = "GIT"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 15,
                SkillName = "TFS"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 16,
                SkillName = "SQL"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 17,
                SkillName = "Agile"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 18,
                SkillName = "Scrum"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 19,
                SkillName = "Unit Testing"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 20,
                SkillName = "Mongo Db"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 21,
                SkillName = "Node.js"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 22,
                SkillName = "React"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 23,
                SkillName = "GitHub"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 24,
                SkillName = "Linux"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 25,
                SkillName = "Python"
            });

            modelBuilder.Entity <Skill>().HasData(new Skill()
            {
                SkillId   = 26,
                SkillName = "SDLC"
            });

            // ADVERTISMENT

            //modelBuilder.Entity<Advertisment>().HasData(new Advertisment()
            //{

            //});



            // Application

            //modelBuilder.Entity<Application>().HasData(new Application()
            //{
            //    ApplicationId = 1,
            //    ApplicationDate = new DateTime(2020, 11, 10),
            //    Description = "Application for job",
            //    UserId = 2,
            //    AdvertismentId = 1
            //});
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //request statuses

            modelBuilder.Entity <RequestStatus>().HasData(new RequestStatus()
            {
                StatusID = 1, statusName = "Na čekanju"
            });
            modelBuilder.Entity <RequestStatus>().HasData(new RequestStatus()
            {
                StatusID = 2, statusName = "Odobren"
            });
            modelBuilder.Entity <RequestStatus>().HasData(new RequestStatus()
            {
                StatusID = 3, statusName = "Odbijen"
            });


            //Schedule statuses
            modelBuilder.Entity <ScheduleStatus>().HasData(new ScheduleStatus()
            {
                StatusID = 1, name = "U toku"
            });
            modelBuilder.Entity <ScheduleStatus>().HasData(new ScheduleStatus()
            {
                StatusID = 2, name = "Završen"
            });

            //Payment types
            modelBuilder.Entity <PaymentType>().HasData(new PaymentType()
            {
                PaymentTypeID = 1, PaymentName = "Plaćanje gotovinom"
            });
            modelBuilder.Entity <PaymentType>().HasData(new PaymentType()
            {
                PaymentTypeID = 2, PaymentName = "Plaćanje kreditnom karticom online"
            });
            //User roles
            modelBuilder.Entity <Roles>().HasData(new Roles()
            {
                RoleID   = 1,
                RoleName = "Administrator"
            });

            modelBuilder.Entity <Roles>().HasData(new Roles()
            {
                RoleID   = 2,
                RoleName = "User"
            });
            //Car brand and models
            modelBuilder.Entity <CarBrands>().HasData(new CarBrands()
            {
                CarBrandID = 1,
                BrandName  = "Volkswagen"
            });
            modelBuilder.Entity <CarBrands>().HasData(new CarBrands()
            {
                CarBrandID = 2,
                BrandName  = "Audi"
            });
            //car models
            modelBuilder.Entity <CarModels>().HasData(new CarModels()
            {
                CarModelID   = 1,
                CarBrandID   = 1,
                CarModelName = "Golf 5"
            });

            modelBuilder.Entity <CarModels>().HasData(new CarModels()
            {
                CarModelID   = 2,
                CarBrandID   = 1,
                CarModelName = "Passat 6"
            });

            modelBuilder.Entity <CarModels>().HasData(new CarModels()
            {
                CarModelID   = 3,
                CarBrandID   = 2,
                CarModelName = "Audi A4 2012"
            });
            //Cities
            modelBuilder.Entity <Cities>().HasData(new Cities()
            {
                CityID   = 1,
                CityName = "Bugojno"
            });
            //Users
            Users u1 = new Users
            {
                UserID      = 1,
                FirstName   = "Mobile",
                LastName    = "Korisnik",
                DateOfBirth = new DateTime(1998, 01, 13),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 2,
                CarBrandID  = 1,
                Email       = "*****@*****.**",
                PhoneNumber = "062/850-277",
                Username    = "******",
                RoleID      = 2
            };

            u1.PasswordSalt = HashGenerator.GenerateSalt();
            u1.PasswordHash = HashGenerator.GenerateHash(u1.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u1);
            Users u3 = new Users
            {
                UserID      = 3,
                FirstName   = "Mobile1",
                LastName    = "Korisnik1",
                DateOfBirth = new DateTime(1998, 01, 13),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 2,
                CarBrandID  = 1,
                Email       = "*****@*****.**",
                PhoneNumber = "062/850-277",
                Username    = "******",
                RoleID      = 2
            };

            u3.PasswordSalt = HashGenerator.GenerateSalt();
            u3.PasswordHash = HashGenerator.GenerateHash(u3.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u3);
            Users u4 = new Users
            {
                UserID      = 4,
                FirstName   = "Mobile2",
                LastName    = "Korisnik2",
                DateOfBirth = new DateTime(1998, 01, 13),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 1,
                CarBrandID  = 1,
                Email       = "*****@*****.**",
                PhoneNumber = "062/850-277",
                Username    = "******",
                RoleID      = 2
            };

            u4.PasswordSalt = HashGenerator.GenerateSalt();
            u4.PasswordHash = HashGenerator.GenerateHash(u4.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u4);
            Users u5 = new Users
            {
                UserID      = 5,
                FirstName   = "Mobile3",
                LastName    = "Korisnik3",
                DateOfBirth = new DateTime(1998, 01, 13),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 1,
                CarBrandID  = 1,
                Email       = "*****@*****.**",
                PhoneNumber = "062/850-277",
                Username    = "******",
                RoleID      = 2
            };

            u5.PasswordSalt = HashGenerator.GenerateSalt();
            u5.PasswordHash = HashGenerator.GenerateHash(u5.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u5);

            Users u6 = new Users
            {
                UserID      = 6,
                FirstName   = "Mobile4",
                LastName    = "Korisnik4",
                DateOfBirth = new DateTime(1998, 01, 13),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 2,
                CarBrandID  = 1,
                Email       = "*****@*****.**",
                PhoneNumber = "062/850-277",
                Username    = "******",
                RoleID      = 2
            };

            u6.PasswordSalt = HashGenerator.GenerateSalt();
            u6.PasswordHash = HashGenerator.GenerateHash(u6.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u6);


            //user admin
            Users u2 = new Users
            {
                UserID      = 2,
                FirstName   = "Desktop",
                LastName    = "Korisnik",
                DateOfBirth = new DateTime(1995, 05, 23),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 2,
                CarBrandID  = 1,
                Email       = "*****@*****.**",
                PhoneNumber = "062/110-677",
                Username    = "******",
                RoleID      = 1
            };

            u2.PasswordSalt = HashGenerator.GenerateSalt();
            u2.PasswordHash = HashGenerator.GenerateHash(u2.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u2);

            Users u7 = new Users
            {
                UserID      = 7,
                FirstName   = "Desktop1",
                LastName    = "Korisnik1",
                DateOfBirth = new DateTime(1995, 05, 23),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 3,
                CarBrandID  = 2,
                Email       = "*****@*****.**",
                PhoneNumber = "062/110-677",
                Username    = "******",
                RoleID      = 1
            };

            u7.PasswordSalt = HashGenerator.GenerateSalt();
            u7.PasswordHash = HashGenerator.GenerateHash(u7.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u7);
            Users u8 = new Users
            {
                UserID      = 8,
                FirstName   = "Desktop2",
                LastName    = "Korisnik2",
                DateOfBirth = new DateTime(1995, 05, 23),
                DateCreated = DateTime.Now,
                CityID      = 1,
                CarModelID  = 3,
                CarBrandID  = 2,
                Email       = "*****@*****.**",
                PhoneNumber = "062/110-677",
                Username    = "******",
                RoleID      = 1
            };

            u8.PasswordSalt = HashGenerator.GenerateSalt();
            u8.PasswordHash = HashGenerator.GenerateHash(u8.PasswordSalt, "test");
            modelBuilder.Entity <Users>().HasData(u8);

            //Car service
            CarService cs1 = new CarService
            {
                CarServiceID     = 1,
                CarServiceName   = "Auto servis RS2",
                CreatedDate      = DateTime.Now,
                CityID           = 1,
                Street           = "Ulica seminarski",
                PhoneNumber      = "062/110-677",
                Owner            = "Desktop korisnik",
                Photo            = File.ReadAllBytes("img/carServicePhoto1.jpg"),
                NumberOfLikes    = 0,
                NumberOfDislikes = 0,
                UserID           = 2
            };

            modelBuilder.Entity <CarService>().HasData(cs1);

            CarService cs2 = new CarService
            {
                CarServiceID     = 2,
                CarServiceName   = "Auto servis FIT",
                CreatedDate      = DateTime.Now,
                CityID           = 1,
                Street           = "Ulica 11",
                PhoneNumber      = "062/110-677",
                Owner            = "Desktop1 Korisnik1",
                Photo            = File.ReadAllBytes("img/carServicePhoto2.jpg"),
                NumberOfLikes    = 0,
                NumberOfDislikes = 0,
                UserID           = 7
            };

            modelBuilder.Entity <CarService>().HasData(cs2);

            CarService cs3 = new CarService
            {
                CarServiceID     = 3,
                CarServiceName   = "Auto servis Ždralović",
                CreatedDate      = DateTime.Now,
                CityID           = 1,
                Street           = "Ulica fit",
                PhoneNumber      = "062/110-677",
                Owner            = "Desktop2 Korisnik2",
                Photo            = File.ReadAllBytes("img/carServicePhoto3.jpg"),
                NumberOfLikes    = 0,
                NumberOfDislikes = 0,
                UserID           = 8
            };

            modelBuilder.Entity <CarService>().HasData(cs3);
            //Services
            Services s1 = new Services {
                ServiceID    = 1,
                CarServiceID = 1,
                ServiceName  = "Servisiranje kočionih diskova",
                ServicePrice = 35,
                Description  = "Nudimo uslugu servisiranja  svega onoga sto je vezano za kočione diskove",
                ServiceTime  = "120"
            };

            modelBuilder.Entity <Services>().HasData(s1);

            Services s2 = new Services
            {
                ServiceID    = 2,
                CarServiceID = 1,
                ServiceName  = "Servisiranje vakumskih pumpi kočnica",
                ServicePrice = 25,
                Description  = "Nudimo uslugu servisiranja  svega onoga sto je vezano za pumpe kočionih diskova",
                ServiceTime  = "120"
            };

            modelBuilder.Entity <Services>().HasData(s2);

            //Services
            Services s3 = new Services
            {
                ServiceID    = 3,
                CarServiceID = 1,
                ServiceName  = "Servisiranje kvačila",
                ServicePrice = 55,
                Description  = "Nudimo uslugu servisiranja pojedinacno ili u cijelini svega onoga sto je vezano za kvačila",
                ServiceTime  = "220"
            };

            modelBuilder.Entity <Services>().HasData(s3);
            Services s4 = new Services
            {
                ServiceID    = 4,
                CarServiceID = 1,
                ServiceName  = "Servisiranje potisnih ležajeva",
                ServicePrice = 30,
                Description  = "Nudimo uslugu servisiranja pojedinacno ili u cijelini svega onoga sto je vezano za potisne ležajeve kvačila",
                ServiceTime  = "220"
            };

            modelBuilder.Entity <Services>().HasData(s4);

            Services s5 = new Services
            {
                ServiceID    = 5,
                CarServiceID = 1,
                ServiceName  = "Servisiranje letve volana",
                ServicePrice = 140,
                Description  = "Nudimo uslugu servisiranja pojedinacno ili u cijelini svega onoga sto je vezano za letvu volana",
                ServiceTime  = "200"
            };

            modelBuilder.Entity <Services>().HasData(s5);
            Services s6 = new Services
            {
                ServiceID    = 6,
                CarServiceID = 1,
                ServiceName  = "Servisiranje servo pumpe",
                ServicePrice = 60,
                Description  = "Nudimo uslugu servisiranja pojedinacno ili u cijelini svega onoga sto je vezano za servo pumpe upravljača",
                ServiceTime  = "270"
            };

            modelBuilder.Entity <Services>().HasData(s6);
            Services s7 = new Services
            {
                ServiceID    = 7,
                CarServiceID = 2,
                ServiceName  = "Servisiranje servo pumpe",
                ServicePrice = 60,
                Description  = "Nudimo uslugu servisiranja pojedinacno ili u cijelini svega onoga sto je vezano za servo pumpe upravljača",
                ServiceTime  = "270"
            };

            modelBuilder.Entity <Services>().HasData(s7);
            Services s8 = new Services
            {
                ServiceID    = 8,
                CarServiceID = 3,
                ServiceName  = "Servisiranje servo pumpe",
                ServicePrice = 60,
                Description  = "Nudimo uslugu servisiranja pojedinacno ili u cijelini svega onoga sto je vezano za servo pumpe upravljača",
                ServiceTime  = "270"
            };

            modelBuilder.Entity <Services>().HasData(s8);
            //CarParts categories and sub categories
            CarPartCategory cpc1 = new CarPartCategory {
                CategoryID = 1, CategoryName = "Kočioni sistemi"
            };
            CarPartCategory cpc2 = new CarPartCategory {
                CategoryID = 2, CategoryName = "Kvačila"
            };
            CarPartCategory cpc3 = new CarPartCategory {
                CategoryID = 3, CategoryName = "Prijenosnik upravljača"
            };

            modelBuilder.Entity <CarPartCategory>().HasData(cpc1);
            modelBuilder.Entity <CarPartCategory>().HasData(cpc2);
            modelBuilder.Entity <CarPartCategory>().HasData(cpc3);

            CarPartSubCategory cps1 = new CarPartSubCategory {
                SubCategoryID = 1, CategoryID = 1, SubCategoryName = "Diskovi za kočnice"
            };
            CarPartSubCategory cps2 = new CarPartSubCategory {
                SubCategoryID = 2, CategoryID = 1, SubCategoryName = "Vakumske pumpe"
            };
            CarPartSubCategory cps3 = new CarPartSubCategory {
                SubCategoryID = 3, CategoryID = 2, SubCategoryName = "Komplet kvačila"
            };
            CarPartSubCategory cps4 = new CarPartSubCategory {
                SubCategoryID = 4, CategoryID = 2, SubCategoryName = "Potisni ležajevi"
            };
            CarPartSubCategory cps5 = new CarPartSubCategory {
                SubCategoryID = 5, CategoryID = 3, SubCategoryName = "Letva volana"
            };
            CarPartSubCategory cps6 = new CarPartSubCategory {
                SubCategoryID = 6, CategoryID = 3, SubCategoryName = "servo pumpa"
            };

            modelBuilder.Entity <CarPartSubCategory>().HasData(cps1);
            modelBuilder.Entity <CarPartSubCategory>().HasData(cps2);
            modelBuilder.Entity <CarPartSubCategory>().HasData(cps3);
            modelBuilder.Entity <CarPartSubCategory>().HasData(cps4);
            modelBuilder.Entity <CarPartSubCategory>().HasData(cps5);
            modelBuilder.Entity <CarPartSubCategory>().HasData(cps6);
            //carparts
            byte[]   photoPart1 = File.ReadAllBytes("img/brakedisc.jpg");
            CarParts cp1        = new CarParts {
                CarPartID     = 1,
                Name          = "Disk za kočnice",
                Photo         = photoPart1,
                Price         = 100,
                Quality       = "Quality I",
                CategoryID    = 1,
                SubCategoryID = 1,
                CarServiceID  = 1
            };



            CarParts cp2 = new CarParts
            {
                CarPartID     = 2,
                Name          = "Disk za kočnice",
                Photo         = photoPart1,
                Price         = 150,
                Quality       = "Quality II",
                CategoryID    = 1,
                SubCategoryID = 1,
                CarServiceID  = 1
            };
            CarParts cp3 = new CarParts
            {
                CarPartID     = 3,
                Name          = "Disk za kočnice",
                Photo         = photoPart1,
                Price         = 200,
                Quality       = "Quality III",
                CategoryID    = 1,
                SubCategoryID = 1,
                CarServiceID  = 1
            };

            modelBuilder.Entity <CarParts>().HasData(cp1);
            modelBuilder.Entity <CarParts>().HasData(cp2);
            modelBuilder.Entity <CarParts>().HasData(cp3);
            byte[]   photoPart2 = File.ReadAllBytes("img/vakumskepumpe.jpg");
            CarParts cp4        = new CarParts
            {
                CarPartID     = 4,
                Name          = "vakumske pumpe",
                Photo         = photoPart2,
                Price         = 200,
                Quality       = "Quality I",
                CategoryID    = 1,
                SubCategoryID = 2,
                CarServiceID  = 1
            };
            CarParts cp5 = new CarParts
            {
                CarPartID     = 5,
                Name          = "vakumske pumpe",
                Photo         = photoPart2,
                Price         = 300,
                Quality       = "Quality II",
                CategoryID    = 1,
                SubCategoryID = 2,
                CarServiceID  = 1
            };
            CarParts cp6 = new CarParts
            {
                CarPartID     = 6,
                Name          = "vakumske pumpe",
                Photo         = photoPart2,
                Price         = 400,
                Quality       = "Quality III",
                CategoryID    = 1,
                SubCategoryID = 2,
                CarServiceID  = 1
            };

            modelBuilder.Entity <CarParts>().HasData(cp4);
            modelBuilder.Entity <CarParts>().HasData(cp5);
            modelBuilder.Entity <CarParts>().HasData(cp6);
            byte[]   photoPart3 = File.ReadAllBytes("img/kvachilo.png");
            CarParts cp7        = new CarParts
            {
                CarPartID     = 7,
                Name          = "Kvaličo",
                Photo         = photoPart3,
                Price         = 135,
                Quality       = "Quality I",
                CategoryID    = 2,
                SubCategoryID = 3,
                CarServiceID  = 1
            };
            CarParts cp8 = new CarParts
            {
                CarPartID     = 8,
                Name          = "Kvačilo",
                Photo         = photoPart3,
                Price         = 202,
                Quality       = "Quality II",
                CategoryID    = 2,
                SubCategoryID = 3,
                CarServiceID  = 1
            };
            CarParts cp9 = new CarParts
            {
                CarPartID     = 9,
                Name          = "Kvačilo",
                Photo         = photoPart3,
                Price         = 270,
                Quality       = "Quality III",
                CategoryID    = 2,
                SubCategoryID = 3,
                CarServiceID  = 1
            };

            modelBuilder.Entity <CarParts>().HasData(cp7);
            modelBuilder.Entity <CarParts>().HasData(cp8);
            modelBuilder.Entity <CarParts>().HasData(cp9);
            byte[]   photoPart4 = File.ReadAllBytes("img/potisnilezajevi.jpeg");
            CarParts cp10       = new CarParts
            {
                CarPartID     = 10,
                Name          = "Potisni ležaj",
                Photo         = photoPart4,
                Price         = 65,
                Quality       = "Quality I",
                CategoryID    = 2,
                SubCategoryID = 4,
                CarServiceID  = 1
            };
            CarParts cp11 = new CarParts
            {
                CarPartID     = 11,
                Name          = "Potisni ležaj",
                Photo         = photoPart4,
                Price         = 97,
                Quality       = "Quality II",
                CategoryID    = 2,
                SubCategoryID = 4,
                CarServiceID  = 1
            };
            CarParts cp12 = new CarParts
            {
                CarPartID     = 12,
                Name          = "Potisni ležaj",
                Photo         = photoPart4,
                Price         = 130,
                Quality       = "Quality III",
                CategoryID    = 2,
                SubCategoryID = 4,
                CarServiceID  = 1
            };

            modelBuilder.Entity <CarParts>().HasData(cp10);
            modelBuilder.Entity <CarParts>().HasData(cp11);
            modelBuilder.Entity <CarParts>().HasData(cp12);
            byte[]   photoPart5 = File.ReadAllBytes("img/lvolana.jpeg");
            CarParts cp13       = new CarParts
            {
                CarPartID     = 13,
                Name          = "Letva volana",
                Photo         = photoPart5,
                Price         = 350,
                Quality       = "Quality I",
                CategoryID    = 3,
                SubCategoryID = 5,
                CarServiceID  = 1
            };
            CarParts cp14 = new CarParts
            {
                CarPartID     = 14,
                Name          = "Letva volana",
                Photo         = photoPart5,
                Price         = 525,
                Quality       = "Quality II",
                CategoryID    = 3,
                SubCategoryID = 5,
                CarServiceID  = 1
            };
            CarParts cp15 = new CarParts
            {
                CarPartID     = 15,
                Name          = "Letva volana",
                Photo         = photoPart5,
                Price         = 700,
                Quality       = "Quality III",
                CategoryID    = 3,
                SubCategoryID = 5,
                CarServiceID  = 1
            };

            modelBuilder.Entity <CarParts>().HasData(cp13);
            modelBuilder.Entity <CarParts>().HasData(cp14);
            modelBuilder.Entity <CarParts>().HasData(cp15);
            byte[]   photoPart6 = File.ReadAllBytes("img/spumpa.jpeg");
            CarParts cp16       = new CarParts
            {
                CarPartID     = 16,
                Name          = "Servo pumpa",
                Photo         = photoPart6,
                Price         = 150,
                Quality       = "Quality I",
                CategoryID    = 3,
                SubCategoryID = 6,
                CarServiceID  = 1
            };
            CarParts cp17 = new CarParts
            {
                CarPartID     = 17,
                Name          = "Servo pumpa",
                Photo         = photoPart6,
                Price         = 225,
                Quality       = "Quality II",
                CategoryID    = 3,
                SubCategoryID = 6,
                CarServiceID  = 1
            };
            CarParts cp18 = new CarParts
            {
                CarPartID     = 18,
                Name          = "Servo pumpa",
                Photo         = photoPart6,
                Price         = 300,
                Quality       = "Quality III",
                CategoryID    = 3,
                SubCategoryID = 6,
                CarServiceID  = 1
            };

            modelBuilder.Entity <CarParts>().HasData(cp16);
            modelBuilder.Entity <CarParts>().HasData(cp17);
            modelBuilder.Entity <CarParts>().HasData(cp18);

            //Requests and schedules

            modelBuilder.Entity <Request>().HasData(new Request()
            {
                RequestID       = 1,
                CarServiceID    = 1,
                DateOfRequest   = DateTime.Now,
                RequestStatusID = 1,
                UserID          = 1
            });
            modelBuilder.Entity <RequestServices>().HasData(new RequestServices()
            {
                RequestServiceID = 1, RequestID = 1, ServiceID = 1
            });
            modelBuilder.Entity <RequestServices>().HasData(new RequestServices()
            {
                RequestServiceID = 2, RequestID = 1, ServiceID = 3
            });
            modelBuilder.Entity <RequestServices>().HasData(new RequestServices()
            {
                RequestServiceID = 3, RequestID = 1, ServiceID = 5
            });
            modelBuilder.Entity <Request>().HasData(new Request()
            {
                RequestID       = 2,
                CarServiceID    = 1,
                DateOfRequest   = DateTime.Now,
                RequestStatusID = 2,
                UserID          = 4
            });
            modelBuilder.Entity <RequestServices>().HasData(new RequestServices()
            {
                RequestServiceID = 4, RequestID = 2, ServiceID = 1
            });
            modelBuilder.Entity <RequestServices>().HasData(new RequestServices()
            {
                RequestServiceID = 5, RequestID = 2, ServiceID = 4
            });
            modelBuilder.Entity <RequestServices>().HasData(new RequestServices()
            {
                RequestServiceID = 6, RequestID = 2, ServiceID = 6
            });
            modelBuilder.Entity <Schedule>().HasData(new Schedule()
            {
                ScheduleID       = 1,
                DateofSchedule   = new DateTime(2020, 09, 18),
                isPaid           = false,
                RequestID        = 2,
                ScheduleStatusID = 2,
                totalPrice       = 125
            });
            //rating za prvi car service
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 1,
                UserID       = 3,
                CarServiceID = 1,
                isLiked      = true,
                isDisliked   = false,
                ScheduleID   = 1
            });
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 2,
                UserID       = 4,
                CarServiceID = 1,
                isLiked      = true,
                isDisliked   = false,
                ScheduleID   = 1
            });
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 3,
                UserID       = 5,
                CarServiceID = 1,
                isLiked      = true,
                isDisliked   = false,
                ScheduleID   = 1
            });
            //rating za drugi car service
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 4,
                UserID       = 3,
                CarServiceID = 2,
                isLiked      = true,
                isDisliked   = false,
                ScheduleID   = 1
            });
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 5,
                UserID       = 4,
                CarServiceID = 2,
                isLiked      = true,
                isDisliked   = false,
                ScheduleID   = 1
            });
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 6,
                UserID       = 5,
                CarServiceID = 2,
                isLiked      = true,
                isDisliked   = false,
                ScheduleID   = 1
            });
            modelBuilder.Entity <Ratings>().HasData(new Ratings()
            {
                RatingID     = 7,
                UserID       = 6,
                CarServiceID = 2,
                isLiked      = false,
                isDisliked   = true,
                ScheduleID   = 1
            });
            //Communication
            modelBuilder.Entity <Communications>().HasData(new Communications()
            {
                CommunicationID = 1,
                UserID          = 1,
                CarServiceID    = 1,
                DateOfMessage   = DateTime.Now,
                Content         = "Pitanje Broj 1",
                AnswerContent   = "Odgovr na pitanje Broj 1",
                isAnswered      = true
            });
            modelBuilder.Entity <Communications>().HasData(new Communications()
            {
                CommunicationID = 2,
                UserID          = 1,
                CarServiceID    = 1,
                DateOfMessage   = DateTime.Now,
                Content         = "Pitanje Broj 2",
                AnswerContent   = null,
                isAnswered      = false
            });
        }
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity <DentalClinic>().HasData(new DentalClinic()
            {
                DentalClinicID = 1,
                Name           = "Dental clinic Ćatić",
                Address        = "Kulina Bana 18",
                Phone          = "030 254-440",
                Email          = "*****@*****.**"
            });

            // CITY

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 1,
                Name   = "Sarajevo"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 2,
                Name   = "Mostar"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 3,
                Name   = "Bugojno"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 4,
                Name   = "G.Vakuf"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 5,
                Name   = "D.Vakuf"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 6,
                Name   = "Travnik"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 7,
                Name   = "Prozor"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityID = 8,
                Name   = "Jajce"
            });


            // Gender

            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderID = 1,
                Type     = "Male"
            });

            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderID = 2,
                Type     = "Female"
            });

            // Treatment

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 1,
                Name         = "Pregled",
                Price        = 20,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment3.png")
            });

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 2,
                Name         = "Vađenje zuba",
                Price        = 25,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment1.jpg")
            });

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 3,
                Name         = "Popravljanje zuba",
                Price        = 30,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment2.jpeg")
            });

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 4,
                Name         = "Hiruško vađenje zuba",
                Price        = 50,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment1.jpg")
            });


            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 5,
                Name         = "Sinus lift",
                Price        = 60,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment4.jpg")
            });

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 6,
                Name         = "Uklanjanje cisti",
                Price        = 40,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment10.png")
            });

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 7,
                Name         = "Fiksna ortodontsa terapija",
                Price        = 1500,
                TimeRequired = 2,
                Image        = File.ReadAllBytes("Images/treatmetn5.png")
            });



            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 8,
                Name         = "Mobilna ortodontsa terapija",
                Price        = 350,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment6.png")
            });

            modelBuilder.Entity <Treatment>().HasData(new Treatment()
            {
                TreatmentID  = 9,
                Name         = "Terapija folijama",
                Price        = 100,
                TimeRequired = 1,
                Image        = File.ReadAllBytes("Images/treatment11.png")
            });

            // Branch

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchID = 1,
                Name     = "Opća stomatologija",
                Title    = "dr. stomatologije",
            });

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchID = 2,
                Name     = "Oralna hirurgija",
                Title    = "dr spec. oralne hirurgije",
            });

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchID = 3,
                Name     = "Ortodoncija",
                Title    = "dr spec. ortodoncije",
            });

            // BranchTreatment

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 1,
                BranchID          = 1, // Opća stomatologija
                TreatmentID       = 1,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 2,
                BranchID          = 1,
                TreatmentID       = 2,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 3,
                BranchID          = 1,
                TreatmentID       = 3,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 4,
                BranchID          = 2,
                TreatmentID       = 1,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 5,
                BranchID          = 2,
                TreatmentID       = 2,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 6,
                BranchID          = 2,
                TreatmentID       = 3,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 7,
                BranchID          = 2,
                TreatmentID       = 4,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 8,
                BranchID          = 2,
                TreatmentID       = 5,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 9,
                BranchID          = 2,
                TreatmentID       = 6,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 10,
                BranchID          = 3,
                TreatmentID       = 7,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 11,
                BranchID          = 3,
                TreatmentID       = 8,
            });

            modelBuilder.Entity <BranchTreatment>().HasData(new BranchTreatment()
            {
                BranchTreatmentID = 12,
                BranchID          = 3,
                TreatmentID       = 9,
            });

            // Dentist


            modelBuilder.Entity <Dentist>().HasData(new Dentist()
            {
                DentistID      = 1,
                DentalClinicID = 1,
                FirstName      = "Besko",
                LastName       = "Sadagić",
                Phone          = "062765123",
                Email          = "*****@*****.**",
                Address        = "Jaklic bb",
                BirthDate      = new DateTime(1970, 01, 13),
                Image          = File.ReadAllBytes("Images/Dentist7.jpg"),
                BranchID       = 1,
                Description    = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna" +
                                 " aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." +
                                 " Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." +
                                 " Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",
                Active = true
            });

            modelBuilder.Entity <Dentist>().HasData(new Dentist()
            {
                DentistID      = 2,
                DentalClinicID = 1,
                FirstName      = "Adnan",
                LastName       = "Frljak",
                Phone          = "062156783",
                Email          = "*****@*****.**",
                Address        = "Lamele",
                BirthDate      = new DateTime(1992, 07, 20),
                Image          = File.ReadAllBytes("Images/Dentist6.jpg"),
                BranchID       = 2,
                Description    = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna" +
                                 " aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." +
                                 " Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." +
                                 " Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",
                Active = true
            });

            modelBuilder.Entity <Dentist>().HasData(new Dentist()
            {
                DentistID      = 3,
                DentalClinicID = 1,
                FirstName      = "Đana",
                LastName       = "Ćatić",
                Phone          = "062456123",
                Email          = "đ[email protected]",
                Address        = "Nugle",
                BirthDate      = new DateTime(1993, 04, 16),
                Image          = File.ReadAllBytes("Images/Dentist2.jpg"),
                BranchID       = 3,
                Description    = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna" +
                                 " aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." +
                                 " Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." +
                                 " Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",
                Active = true
            });

            // Role

            modelBuilder.Entity <Role>().HasData(new Role()
            {
                RoleID = 1,
                Name   = "Administrator"
            });

            modelBuilder.Entity <Role>().HasData(new Role()
            {
                RoleID = 2,
                Name   = "Client"
            });

            // Client

            User u1 = new User
            {
                UserID         = 1,
                DentalClinicID = 1,
                CityID         = 3,
                GenderID       = 1,
                FirstName      = "Mobile1",
                LastName       = "Client1",
                Username       = "******",
                Phone          = "062456982",
                Email          = "*****@*****.**",
                Address        = "Sultan Ahmedova bb",
                BirthDate      = new DateTime(1997, 07, 15),
                Image          = File.ReadAllBytes("Images/userDefault.png")
            };

            u1.PasswordSalt = HashGenerator.GenerateSalt();
            u1.PasswordHash = HashGenerator.GenerateHash(u1.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u1);

            User u2 = new User
            {
                UserID         = 2,
                DentalClinicID = 1,
                CityID         = 4,
                GenderID       = 2,
                FirstName      = "Mobile2",
                LastName       = "Client2",
                Username       = "******",
                Phone          = "062123756",
                Email          = "*****@*****.**",
                Address        = "Nugle 2 4/b",
                BirthDate      = new DateTime(2001, 02, 09),
                Image          = File.ReadAllBytes("Images/userDefault.png")
            };

            u2.PasswordSalt = HashGenerator.GenerateSalt();
            u2.PasswordHash = HashGenerator.GenerateHash(u2.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u2);

            User u3 = new User
            {
                UserID         = 3,
                DentalClinicID = 1,
                CityID         = 5,
                GenderID       = 1,
                FirstName      = "Mobile3",
                LastName       = "Client3",
                Username       = "******",
                Phone          = "062567234",
                Email          = "*****@*****.**",
                Address        = "Kulina Bana bb",
                BirthDate      = new DateTime(1999, 05, 05),
                Image          = File.ReadAllBytes("Images/userDefault.png")
            };

            u3.PasswordSalt = HashGenerator.GenerateSalt();
            u3.PasswordHash = HashGenerator.GenerateHash(u3.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u3);

            // Administrator

            User u4 = new User
            {
                UserID         = 4,
                DentalClinicID = 1,
                CityID         = 3,
                GenderID       = 1,
                FirstName      = "User",
                LastName       = "Desktop",
                Username       = "******",
                Phone          = "062654763",
                Email          = "*****@*****.**",
                Address        = "Nugle 2 4/b",
                BirthDate      = new DateTime(1993, 02, 21),
                Image          = File.ReadAllBytes("Images/userDefault.png")
            };

            u4.PasswordSalt = HashGenerator.GenerateSalt();
            u4.PasswordHash = HashGenerator.GenerateHash(u4.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u4);


            // UserRole

            modelBuilder.Entity <UserRole>().HasData(new UserRole()
            {
                UserRoleID = 1,
                UserID     = 1,
                RoleID     = 2
            });

            modelBuilder.Entity <UserRole>().HasData(new UserRole()
            {
                UserRoleID = 2,
                UserID     = 2,
                RoleID     = 2
            });

            modelBuilder.Entity <UserRole>().HasData(new UserRole()
            {
                UserRoleID = 3,
                UserID     = 3,
                RoleID     = 2
            });

            modelBuilder.Entity <UserRole>().HasData(new UserRole()
            {
                UserRoleID = 4,
                UserID     = 4,
                RoleID     = 1
            });


            // Appointment

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 1,
                UserID        = 1,
                DentistID     = 1,
                TreatmentID   = 1,
                StartDate     = new DateTime(2021, 02, 08, 09, 0, 0),
                EndDate       = new DateTime(2021, 02, 08, 10, 0, 0),
                RatingStatus  = true,
            });

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 2,
                UserID        = 2,
                DentistID     = 2,
                TreatmentID   = 1,
                StartDate     = new DateTime(2021, 02, 08, 09, 0, 0),
                EndDate       = new DateTime(2021, 02, 08, 10, 0, 0),
                RatingStatus  = true,
            });

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 3,
                UserID        = 3,
                DentistID     = 3,
                TreatmentID   = 1,
                StartDate     = new DateTime(2021, 02, 08, 09, 0, 0),
                EndDate       = new DateTime(2021, 02, 08, 10, 0, 0),
                RatingStatus  = true,
            });

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 4,
                UserID        = 1,
                DentistID     = 1,
                TreatmentID   = 3,
                StartDate     = new DateTime(2021, 02, 15, 12, 0, 0),
                EndDate       = new DateTime(2021, 02, 15, 13, 0, 0),
                RatingStatus  = true,
            });

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 5,
                UserID        = 2,
                DentistID     = 2,
                TreatmentID   = 6,
                StartDate     = new DateTime(2021, 02, 17, 13, 0, 0),
                EndDate       = new DateTime(2021, 02, 17, 14, 0, 0),
                RatingStatus  = true,
            });

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 6,
                UserID        = 1,
                DentistID     = 2,
                TreatmentID   = 1,
                StartDate     = new DateTime(2021, 03, 06, 12, 0, 0),
                EndDate       = new DateTime(2021, 03, 06, 13, 0, 0),
                RatingStatus  = true,
            });

            modelBuilder.Entity <Appointment>().HasData(new Appointment()
            {
                AppointmentID = 7,
                UserID        = 2,
                DentistID     = 1,
                TreatmentID   = 1,
                StartDate     = new DateTime(2021, 03, 08, 13, 0, 0),
                EndDate       = new DateTime(2021, 03, 08, 14, 0, 0),
                RatingStatus  = true,
            });

            // Rating

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 1,
                UserID        = 1,
                DentistID     = 1,
                DentistRating = 9,
                RatingDate    = new DateTime(2021, 02, 08),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 2,
                UserID        = 2,
                DentistID     = 2,
                DentistRating = 10,
                RatingDate    = new DateTime(2021, 02, 08),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 3,
                UserID        = 3,
                DentistID     = 3,
                DentistRating = 10,
                RatingDate    = new DateTime(2021, 02, 08),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 4,
                UserID        = 1,
                DentistID     = 1,
                DentistRating = 8,
                RatingDate    = new DateTime(2021, 02, 15),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 5,
                UserID        = 2,
                DentistID     = 2,
                DentistRating = 9,
                RatingDate    = new DateTime(2021, 02, 17),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 6,
                UserID        = 1,
                DentistID     = 2,
                DentistRating = 7,
                RatingDate    = new DateTime(2021, 03, 06),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingID      = 7,
                UserID        = 2,
                DentistID     = 1,
                DentistRating = 8,
                RatingDate    = new DateTime(2021, 03, 08),
                Comment       = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
            });

            // Topic

            modelBuilder.Entity <Topic>().HasData(new Topic()
            {
                TopicID     = 1,
                UserID      = 1,
                Subject     = "Test",
                Description = "Test",
                Text        = "Test",
                Date        = new DateTime(2021, 03, 08),
            });

            // Comment

            modelBuilder.Entity <Comment>().HasData(new Comment()
            {
                CommentID = 1,
                UserID    = 2,
                TopicID   = 1,
                Text      = "Test",
                Date      = new DateTime(2021, 03, 08),
            });

            // Payment

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 1,
                UserID      = 1,
                TreatmentID = 1,
                Amount      = 20,
                Date        = new DateTime(2021, 02, 08),
            });

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 2,
                UserID      = 2,
                TreatmentID = 1,
                Amount      = 20,
                Date        = new DateTime(2021, 02, 08),
            });

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 3,
                UserID      = 3,
                TreatmentID = 1,
                Amount      = 20,
                Date        = new DateTime(2021, 02, 08),
            });

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 4,
                UserID      = 1,
                TreatmentID = 3,
                Amount      = 30,
                Date        = new DateTime(2021, 02, 15),
            });

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 5,
                UserID      = 2,
                TreatmentID = 6,
                Amount      = 40,
                Date        = new DateTime(2021, 02, 17),
            });

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 6,
                UserID      = 1,
                TreatmentID = 1,
                Amount      = 20,
                Date        = new DateTime(2021, 03, 06),
            });

            modelBuilder.Entity <Payment>().HasData(new Payment()
            {
                PaymentID   = 7,
                UserID      = 2,
                TreatmentID = 1,
                Amount      = 20,
                Date        = new DateTime(2021, 03, 08),
            });

            // Notification

            modelBuilder.Entity <Notification>().HasData(new Notification()
            {
                NotificationID   = 1,
                Title            = "Test",
                Text             = "Test",
                NotificationDate = new DateTime(2021, 03, 08),
                UserID           = 4,
            });
        }
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            // user types
            modelBuilder.Entity <UserType>().HasData(new UserType()
            {
                Id   = 1,
                Type = "Admin"
            });

            modelBuilder.Entity <UserType>().HasData(new UserType()
            {
                Id   = 2,
                Type = "MobileAppUser"
            });

            // admin
            User u1 = new User
            {
                Id         = 1,
                UserTypeId = 1,
                Username   = "******",
                Phone      = "061234567",
                FirstName  = "Ajdin",
                LastName   = "Xata",
                Email      = "*****@*****.**",
            };

            u1.PasswordSalt = HashGenerator.GenerateSalt();
            u1.PasswordHash = HashGenerator.GenerateHash(u1.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u1);

            // mobile user
            User u2 = new User
            {
                Id         = 2,
                UserTypeId = 2,
                Username   = "******",
                Phone      = "061234567",
                FirstName  = "Mobile",
                LastName   = "Test",
                Email      = "*****@*****.**",
            };

            u2.PasswordSalt = HashGenerator.GenerateSalt();
            u2.PasswordHash = HashGenerator.GenerateHash(u2.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u2);

            // prod. companies
            modelBuilder.Entity <ProductionCompany>().HasData(new ProductionCompany()
            {
                Id = 1,
                ProductionCompanyName = "Paramount pictures"
            });
            modelBuilder.Entity <ProductionCompany>().HasData(new ProductionCompany()
            {
                Id = 2,
                ProductionCompanyName = "MGM"
            });
            modelBuilder.Entity <ProductionCompany>().HasData(new ProductionCompany()
            {
                Id = 3,
                ProductionCompanyName = "Marvel"
            });

            // genres
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 1,
                GenreName = "Drama"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 2,
                GenreName = "Crime"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 3,
                GenreName = "Horror"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 4,
                GenreName = "Action"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 5,
                GenreName = "Comedy"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 6,
                GenreName = "Mystery"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 7,
                GenreName = "Sci-Fi"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 8,
                GenreName = "Thriller"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 9,
                GenreName = "Animation"
            });
            modelBuilder.Entity <Genre>().HasData(new Genre()
            {
                Id        = 10,
                GenreName = "Fantasy"
            });

            // mtvs
            MovieAndTvshow m1 = new MovieAndTvshow
            {
                Id                  = 1,
                Title               = "The Godfather",
                ReleaseDate         = new DateTime(1972, 1, 27),
                Budget              = 100000000,
                Language            = "English",
                Finished            = true,
                NumberOfRatings     = 1,
                RunningTime         = "130",
                ProductionCompanyId = 1,
                Poster              = File.ReadAllBytes("img/the_godfather.jpg"),
                Description         = @"The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.",
            };

            modelBuilder.Entity <MovieAndTvshow>().HasData(m1);

            MovieAndTvshow m2 = new MovieAndTvshow
            {
                Id                  = 2,
                Title               = "Mr. Robot",
                ReleaseDate         = new DateTime(2015, 5, 20),
                Budget              = 100000000,
                Language            = "English",
                Finished            = true,
                NumberOfRatings     = 1,
                RunningTime         = "45",
                ProductionCompanyId = 3,
                Poster              = File.ReadAllBytes("img/mr_robot.jpg"),
                Description         = "Elliot, a brilliant but highly unstable young cyber-security engineer and vigilante hacker, becomes a key figure in a complex game of global dominance when he and his shadowy allies try to take down the corrupt corporation he works for."
            };

            modelBuilder.Entity <MovieAndTvshow>().HasData(m2);

            MovieAndTvshow m3 = new MovieAndTvshow
            {
                Id                  = 3,
                Title               = "The Curious Case of Benjamin Button",
                ReleaseDate         = new DateTime(2006, 5, 20),
                Budget              = 100000000,
                Language            = "English",
                Finished            = true,
                NumberOfRatings     = 1,
                RunningTime         = "175",
                ProductionCompanyId = 3,
                Poster              = File.ReadAllBytes("img/benjamin_button.jpg"),
                Description         = "Tells the story of Benjamin Button, a man who starts aging backwards with consequences."
            };

            modelBuilder.Entity <MovieAndTvshow>().HasData(m3);

            MovieAndTvshow m4 = new MovieAndTvshow
            {
                Id                  = 4,
                Title               = "Fight Club",
                ReleaseDate         = new DateTime(1999, 5, 20),
                Budget              = 100000000,
                Language            = "English",
                Finished            = true,
                NumberOfRatings     = 1,
                RunningTime         = "175",
                ProductionCompanyId = 3,
                Poster              = File.ReadAllBytes("img/fight_club.jpg"),
                Description         = "An insomniac office worker and a devil-may-care soapmaker form an underground fight club that evolves into something much, much more."
            };

            modelBuilder.Entity <MovieAndTvshow>().HasData(m4);

            // mtvs genres
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 1,
                GenreId          = 1,
                MovieAndTvshowId = 1
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 2,
                GenreId          = 2,
                MovieAndTvshowId = 1
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 3,
                GenreId          = 1,
                MovieAndTvshowId = 2
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 4,
                GenreId          = 2,
                MovieAndTvshowId = 2
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 5,
                GenreId          = 8,
                MovieAndTvshowId = 3
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 6,
                GenreId          = 2,
                MovieAndTvshowId = 3
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 7,
                GenreId          = 9,
                MovieAndTvshowId = 3
            });
            modelBuilder.Entity <MovieAndTvshowGenre>().HasData(new MovieAndTvshowGenre()
            {
                Id               = 8,
                GenreId          = 1,
                MovieAndTvshowId = 4
            });

            // rating
            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                Id = 1,
                MovieAndTvshowId = 1,
                AppUserId        = 2,
                RatingValue      = 100
            });
            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                Id = 2,
                MovieAndTvshowId = 2,
                AppUserId        = 2,
                RatingValue      = 88
            });
            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                Id = 3,
                MovieAndTvshowId = 3,
                AppUserId        = 2,
                RatingValue      = 99
            });
            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                Id = 4,
                MovieAndTvshowId = 4,
                AppUserId        = 2,
                RatingValue      = 76
            });

            // quote
            modelBuilder.Entity <Quote>().HasData(new Quote()
            {
                Id               = 1,
                QuoteText        = "Friendship is everything. Friendship is more than talent. It is more than the government.",
                MovieAndTvshowId = 1
            });
            modelBuilder.Entity <Quote>().HasData(new Quote()
            {
                Id               = 2,
                QuoteText        = "A friend should always underestimate your virtues and an enemy overestimate your faults.",
                MovieAndTvshowId = 1
            });

            //roles
            modelBuilder.Entity <Role>().HasData(new Role()
            {
                Id       = 1,
                RoleName = "Actor"
            });
            modelBuilder.Entity <Role>().HasData(new Role()
            {
                Id       = 2,
                RoleName = "Director"
            });
            modelBuilder.Entity <Role>().HasData(new Role()
            {
                Id       = 3,
                RoleName = "Writter"
            });
            modelBuilder.Entity <Role>().HasData(new Role()
            {
                Id       = 4,
                RoleName = "Producer"
            });

            // seasons & episodes
            modelBuilder.Entity <TvshowSeason>().HasData(new TvshowSeason()
            {
                Id = 1,
                MovieAndTvshowId = 2,
                Finished         = true,
                SeasonName       = "Season 1",
            });
            modelBuilder.Entity <TvshowSeason>().HasData(new TvshowSeason()
            {
                Id = 2,
                MovieAndTvshowId = 2,
                Finished         = true,
                SeasonName       = "Season 2",
            });

            modelBuilder.Entity <TvshowSeasonEpisode>().HasData(new TvshowSeasonEpisode()
            {
                Id             = 1,
                EpisodeNumber  = 1,
                TvshowSeasonId = 1,
                TvshowId       = 2,
                AirDate        = new DateTime(2015, 3, 15),
                EpisodeName    = "eps1.0_hellofriend.mov"
            });
            modelBuilder.Entity <TvshowSeasonEpisode>().HasData(new TvshowSeasonEpisode()
            {
                Id             = 2,
                EpisodeNumber  = 2,
                TvshowSeasonId = 1,
                TvshowId       = 2,
                AirDate        = new DateTime(2015, 3, 19),
                EpisodeName    = "eps1.1_ones-and-zer0es.mpeg"
            });
            modelBuilder.Entity <TvshowSeasonEpisode>().HasData(new TvshowSeasonEpisode()
            {
                Id             = 3,
                EpisodeNumber  = 1,
                TvshowSeasonId = 2,
                TvshowId       = 2,
                AirDate        = new DateTime(2016, 3, 19),
                EpisodeName    = "eps2.1_EPISODE1.mpeg"
            });

            // person
            Person p1 = new Person
            {
                Id           = 1,
                FirstName    = "Al",
                LastName     = "Pacino",
                Biography    = "Alfredo James Pacino established himself as a film actor during one of cinema's most vibrant decades, the 1970s, and has become an enduring and iconic figure in the world of American movies. He was born April 25, 1940 in Manhattan, New York City, to Italian-American parents, Rose (nee Gerardi) and Sal Pacino. They divorced when he was young",
                DateOfBirth  = new DateTime(1940, 4, 25),
                DateOfDeath  = null,
                Gender       = "M",
                Photo        = File.ReadAllBytes("img/al_pacino.jpg"),
                PlaceOfBirth = "Manhattan, New York City, New York, USA"
            };

            modelBuilder.Entity <Person>().HasData(p1);

            Person p2 = new Person
            {
                Id           = 2,
                FirstName    = "Francis",
                LastName     = "Ford Coppola",
                Biography    = "Francis Ford Coppola was born in 1939 in Detroit, Michigan, but grew up in a New York suburb in a creative, supportive Italian-American family. His father, Carmine Coppola, was a composer and musician. His mother, Italia Coppola (née Pennino), had been an actress. Francis Ford Coppola graduated with a degree in drama from Hofstra University.",
                DateOfBirth  = new DateTime(1939, 7, 4),
                DateOfDeath  = null,
                Gender       = "M",
                Photo        = File.ReadAllBytes("img/ford_coppola.jpg"),
                PlaceOfBirth = "Detroit, Michigan, USA"
            };

            modelBuilder.Entity <Person>().HasData(p2);

            Person p3 = new Person
            {
                Id           = 3,
                FirstName    = "Brad",
                LastName     = "Pitt",
                Biography    = "An actor and producer known as much for his versatility as he is for his handsome face, Golden Globe-winner Brad Pitt's most widely recognized role may be Tyler Durden in Fight Club (1999). However, his portrayals of Billy Beane in Moneyball (2011), and Rusty Ryan in the remake of Ocean's Eleven (2001) and its sequels, also loom large in his ...",
                DateOfBirth  = new DateTime(1970, 7, 4),
                DateOfDeath  = null,
                Gender       = "M",
                Photo        = File.ReadAllBytes("img/brad_pitt.jpg"),
                PlaceOfBirth = "Los Angeles"
            };

            modelBuilder.Entity <Person>().HasData(p3);

            Person p4 = new Person
            {
                Id           = 4,
                FirstName    = "David",
                LastName     = "Fincher",
                Biography    = "An actor and producer known as much for his versatility as he is for his handsome face, Golden Globe-winner Brad Pitt's most widely recognized role may be Tyler Durden in Fight Club (1999). However, his portrayals of Billy Beane in Moneyball (2011), and Rusty Ryan in the remake of Ocean's Eleven (2001) and its sequels, also loom large in his ...",
                DateOfBirth  = new DateTime(1965, 7, 4),
                DateOfDeath  = null,
                Gender       = "M",
                Photo        = File.ReadAllBytes("img/david_fincher.jpg"),
                PlaceOfBirth = "New York"
            };

            modelBuilder.Entity <Person>().HasData(p4);

            // mtvs person
            modelBuilder.Entity <MovieAndTvshowPerson>().HasData(new MovieAndTvshowPerson()
            {
                Id = 1,
                MovieAndTvshowId = 1,
                PersonId         = 1,
                NameInMovie      = "Michael Corleone",
                RoleId           = 1
            });
            modelBuilder.Entity <MovieAndTvshowPerson>().HasData(new MovieAndTvshowPerson()
            {
                Id = 2,
                MovieAndTvshowId = 1,
                PersonId         = 2,
                RoleId           = 2
            });
            modelBuilder.Entity <MovieAndTvshowPerson>().HasData(new MovieAndTvshowPerson()
            {
                Id = 3,
                MovieAndTvshowId = 3,
                PersonId         = 3,
                RoleId           = 1,
                NameInMovie      = "Benjamin Button"
            });
            modelBuilder.Entity <MovieAndTvshowPerson>().HasData(new MovieAndTvshowPerson()
            {
                Id = 4,
                MovieAndTvshowId = 4,
                PersonId         = 3,
                RoleId           = 1,
                NameInMovie      = "Tyler Durden"
            });
            modelBuilder.Entity <MovieAndTvshowPerson>().HasData(new MovieAndTvshowPerson()
            {
                Id = 5,
                MovieAndTvshowId = 3,
                PersonId         = 4,
                RoleId           = 2,
            });
            modelBuilder.Entity <MovieAndTvshowPerson>().HasData(new MovieAndTvshowPerson()
            {
                Id = 6,
                MovieAndTvshowId = 4,
                PersonId         = 4,
                RoleId           = 2,
            });

            // news
            News n1 = new News
            {
                Id             = 1,
                AuthorId       = 1,
                DateTimeOfNews = new DateTime(2020, 5, 17, 12, 12, 12),
                Title          = "Awesome MCU Supercut Shows The Infinity Saga",
                Content        = @"A new fan edit combines the entire Infinity Saga into two minutes. At this point, whether a superhero fan or not, almost everybody has at least heard about the Marvel Cinematic Universe. So far, there have been 23 movies in the MCU, which have introduced over a dozen superheroes across eleven years.
                            Marvel Studios and Paramount Pictures started the universe out strong with Iron Man in 2008 years,
                            but all of the films were building up to the events of Avengers: Endgame.Now, one fan has condensed the eleven-year venture into one 2 minute clip.",
                CoverPhoto     = File.ReadAllBytes("img/news1.jpg"),
            };

            modelBuilder.Entity <News>().HasData(n1);
            News n2 = new News
            {
                Id             = 2,
                AuthorId       = 1,
                DateTimeOfNews = new DateTime(2020, 5, 20, 12, 12, 14),
                Title          = "Kristen Stewart Is Princess Diana in Pablo Larraín's Spencer",
                Content        = @"Charlie's Angels star Kristen Stewart is set to portray Princess Di in the upcoming drama movie Spencer, and Pablo Larraín is also on board to direct the project with Peaky Blinders writer Steven Knight penning the screenplay. Known for directing movies like Jackie and Neruda, Larraín will also be serving as a producer for Spencer in addition to helming the project. Larraín's Fabula partners Juan de Dios, Jonas Dornbach, Janine Jackowski, and Paul Webster will also produce.
                            Spencer is not quite a Princess Diana biopic, focusing particularly on one critical weekend in her life in the early '90s. Taking place over the span of three days, the movie delves into the moments when Diana decided her marriage to Prince Charles wasn't working, and that she needed to veer from a path that put her in line to one day be queen. Famously, Diana and Charles had divorced in 1996 after the two had been married since 1981, and the sordid details of their relationship had been highly publicized at the time. After walking away from royalty, the former Princess of Wales was killed in 1997 as the result of a devastating car crash while fleeing from paparazzi, but that incident won't be covered in the movie.",
                CoverPhoto     = File.ReadAllBytes("img/news2.jpg"),
            };

            modelBuilder.Entity <News>().HasData(n2);
            News n3 = new News
            {
                Id             = 3,
                AuthorId       = 1,
                DateTimeOfNews = new DateTime(2020, 5, 19, 12, 12, 16),
                Title          = "Is Disney+ Planning a Bunch of Star Wars Interconnected Live-Action TV Shows for 2021?",
                Content        = @"We might be getting a whole lot more Star Wars on the small screen in the not-too-distant future. This, according to a new rumor (with rumor being the keyword for now) that suggests Lucasfilm is gearing up to bring a series of live-action shows set within a galaxy far, far away to Disney+ starting next year. Game of Thrones is being used as a comparison.
                            Before we dive in we must again caution that this should only be regarded as a rumor for the time being, and nothing more.That said, it does line up with much of what we've been hearing about The Mandalorian season 2, as well as other rumors floating around. According to a new report, starting in mid-2021, Disney and Lucasfilm plan to release a new season of a live-action Star Wars show every quarter. These shows will feature an interconnected storyline, but each series will be able to stand alone. It is compared to the way Game of Thrones featured various families. In this case, each family would get its own show.",
                CoverPhoto     = File.ReadAllBytes("img/news3.jpg"),
            };

            modelBuilder.Entity <News>().HasData(n3);

            // comment
            Comment c1 = new Comment
            {
                Id                = 1,
                AppUserId         = 2,
                DateTimeOfComment = new DateTime(2020, 7, 15),
                MovieAndTvshowId  = 1,
                Content           = "Great movie !"
            };

            modelBuilder.Entity <Comment>().HasData(c1);
            Comment c2 = new Comment
            {
                Id                = 2,
                AppUserId         = 2,
                DateTimeOfComment = new DateTime(2020, 7, 16),
                MovieAndTvshowId  = 1,
                Content           = "Amazing !"
            };

            modelBuilder.Entity <Comment>().HasData(c2);
        }
Esempio n. 12
0
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity <City>().HasData(new List <City>
            {
                new City
                {
                    Id      = 1,
                    Name    = "Sarajevo",
                    ZipCode = 71000
                },
                new City
                {
                    Id      = 2,
                    Name    = "Mostar",
                    ZipCode = 88000
                },
                new City
                {
                    Id      = 3,
                    Name    = "Tuzla",
                    ZipCode = 75000
                }
            });
            modelBuilder.Entity <Fuel>().HasData(new List <Fuel>()
            {
                new Fuel
                {
                    Id   = 1,
                    Name = "Dizel"
                },
                new Fuel
                {
                    Id   = 2,
                    Name = "Benzin"
                },
                new Fuel
                {
                    Id   = 3,
                    Name = "Automatic"
                }
            });
            modelBuilder.Entity <Brand>().HasData(new List <Brand>()
            {
                new Brand
                {
                    Id              = 1,
                    Name            = "BMW",
                    ManufacturerUrl = "https://www.bmw.com/en/index.html"
                },
                new Brand
                {
                    Id              = 2,
                    Name            = "Audi",
                    ManufacturerUrl = "https://www.audi.com/en.html"
                },
                new Brand
                {
                    Id              = 3,
                    Name            = "Mercedes",
                    ManufacturerUrl = "https://www.mercedes.com/"
                },
                new Brand
                {
                    Id              = 4,
                    Name            = "Passat",
                    ManufacturerUrl = "https://www.passat.com/"
                },
                new Brand
                {
                    Id              = 5,
                    Name            = "Porsche",
                    ManufacturerUrl = "https://www.porsche.com/"
                },
                new Brand
                {
                    Id              = 6,
                    Name            = "Citroen",
                    ManufacturerUrl = "https://www.citroen.com/"
                }
            });
            modelBuilder.Entity <Role>().HasData(new List <Role>
            {
                new Role
                {
                    Id   = 1,
                    Name = "Administrator"
                },
                new Role
                {
                    Id   = 2,
                    Name = "User"
                }
            });
            User user = new User
            {
                Id        = 1,
                FirstName = "Ajdin",
                LastName  = "Tabak",
                Username  = "******",
                CityId    = 1,
                Phone     = "062234124",
                Email     = "*****@*****.**",
                Active    = true,
                RoleId    = 1
            };

            user.PasswordSalt = HashGenerator.GenerateSalt();
            user.PasswordHash = HashGenerator.GenerateHash(user.PasswordSalt, "admin");

            User user2 = new User
            {
                Id        = 2,
                FirstName = "Test",
                LastName  = "User",
                Username  = "******",
                CityId    = 1,
                Phone     = "062234124",
                Email     = "*****@*****.**",
                Active    = true,
                RoleId    = 2
            };

            user2.PasswordSalt = HashGenerator.GenerateSalt();
            user2.PasswordHash = HashGenerator.GenerateHash(user2.PasswordSalt, "user");

            modelBuilder.Entity <User>().HasData(user);
            modelBuilder.Entity <User>().HasData(user2);

            modelBuilder.Entity <VehicleModel>().HasData(new List <VehicleModel>
            {
                new VehicleModel
                {
                    Id   = 1,
                    Name = "A6"
                },
                new VehicleModel
                {
                    Id   = 2,
                    Name = "A7"
                },
                new VehicleModel
                {
                    Id   = 3,
                    Name = "530d"
                },
                new VehicleModel
                {
                    Id   = 4,
                    Name = "c220"
                },
                new VehicleModel
                {
                    Id   = 5,
                    Name = "8"
                },
                new VehicleModel
                {
                    Id   = 6,
                    Name = "4S"
                },
                new VehicleModel
                {
                    Id   = 7,
                    Name = "C5"
                }
            });

            modelBuilder.Entity <VehicleType>().HasData(new List <VehicleType> {
                new VehicleType
                {
                    Id   = 1,
                    Name = "Sedan"
                },
                new VehicleType
                {
                    Id   = 2,
                    Name = "SUV"
                },
                new VehicleType
                {
                    Id   = 3,
                    Name = "Convertible"
                },
                new VehicleType
                {
                    Id   = 4,
                    Name = "Sports Car"
                },
            });
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 1,
                Name             = "Audi A6",
                Image            = File.ReadAllBytes("img/audia6.jpg"),
                Price            = 100,
                Description      = "Audi A6 3.0 TDI Quattro. Ready for every task.",
                YearManufactured = 2018,
                Transmission     = "Automatic",
                NumberOfSeats    = 5,
                IsActive         = true,
                BrandId          = 2,
                FuelId           = 1,
                VehicleTypeId    = 4,
                VehicleModelId   = 1
            });

            // Audi A7
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 2,
                Name             = "Audi A7",
                Image            = File.ReadAllBytes("img/audia7.jpg"),
                Price            = 120,
                Description      = "Audi A7 3.0 TFSI Quattro. Ready for every task.",
                YearManufactured = 2019,
                Transmission     = "Automatic",
                NumberOfSeats    = 5,
                IsActive         = true,
                BrandId          = 2,
                FuelId           = 1,
                VehicleTypeId    = 4,
                VehicleModelId   = 2
            });

            // BMW 530d
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 3,
                Name             = "BMW 530D",
                Image            = File.ReadAllBytes("img/bmw.jpg"),
                Price            = 90,
                Description      = "BMW 530d 258 KS. Ready for every task.",
                YearManufactured = 2017,
                Transmission     = "Manual",
                NumberOfSeats    = 5,
                IsActive         = true,
                BrandId          = 1,
                FuelId           = 1,
                VehicleTypeId    = 1,
                VehicleModelId   = 3
            });

            // Mercedes c220
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 4,
                Name             = "Mercedes C220",
                Image            = File.ReadAllBytes("img/mercedes.jpg"),
                Price            = 100,
                Description      = "Mercedes-Benz C220 CDI 170 KS. Ready for every task.",
                YearManufactured = 2016,
                Transmission     = "Automatic",
                NumberOfSeats    = 5,
                IsActive         = true,
                BrandId          = 3,
                FuelId           = 1,
                VehicleTypeId    = 2,
                VehicleModelId   = 4
            });

            // Passat 8
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 5,
                Name             = "Passat 8",
                Image            = File.ReadAllBytes("img/passat.jfif"),
                Price            = 100,
                Description      = "Volkswagen Passat 8 170 KS. Ready for every task.",
                YearManufactured = 2019,
                Transmission     = "Manual",
                NumberOfSeats    = 4,
                IsActive         = true,
                BrandId          = 4,
                FuelId           = 1,
                VehicleTypeId    = 4,
                VehicleModelId   = 5
            });

            // Porsche 4S
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 6,
                Name             = "Porsche 4S",
                Image            = File.ReadAllBytes("img/porsche.jpg"),
                Price            = 150,
                Description      = "Porsche Carrera 4S 350 KS. Ready for every task.",
                YearManufactured = 2019,
                Transmission     = "Automatic",
                NumberOfSeats    = 2,
                IsActive         = true,
                BrandId          = 5,
                FuelId           = 2,
                VehicleTypeId    = 4,
                VehicleModelId   = 6
            });

            // Citroen C5
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                Id               = 7,
                Name             = "Citroen C5",
                Image            = File.ReadAllBytes("img/citroen.jpg"),
                Price            = 90,
                Description      = "Citroen C5 150 KS. Ready for everyday tasks.",
                YearManufactured = 2016,
                Transmission     = "Automatic",
                NumberOfSeats    = 5,
                IsActive         = true,
                BrandId          = 6,
                FuelId           = 1,
                VehicleTypeId    = 3,
                VehicleModelId   = 7
            });

            // BOOKING

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 1,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 16),
                UserId      = 2,
                VehicleId   = 1,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 200
            });

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 2,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 17),
                UserId      = 2,
                VehicleId   = 2,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 360
            });

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 3,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 17),
                UserId      = 2,
                VehicleId   = 3,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 270
            });

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 4,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 17),
                UserId      = 2,
                VehicleId   = 4,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 300
            });

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 5,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 17),
                UserId      = 2,
                VehicleId   = 5,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 300
            });

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 6,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 17),
                UserId      = 2,
                VehicleId   = 6,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 450
            });

            modelBuilder.Entity <Rent>().HasData(new Rent()
            {
                Id          = 7,
                StartDate   = new DateTime(2021, 02, 14),
                EndDate     = new DateTime(2021, 02, 17),
                UserId      = 2,
                VehicleId   = 7,
                DateCreated = new DateTime(2021, 02, 13),
                IsCanceled  = false,
                IsReviewed  = true,
                TotalPrice  = 270
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 1,
                Comment       = "Audi A6 is fenomenal. I recommend!",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 1,
                NumberOfStars = 5
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 2,
                Comment       = "Audi A7 was mediocre.",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 2,
                NumberOfStars = 3
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 3,
                Comment       = "It was good enough",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 2,
                NumberOfStars = 4
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 4,
                Comment       = "It was good enough",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 3,
                NumberOfStars = 5
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 5,
                Comment       = "Not good enough",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 5,
                NumberOfStars = 2
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 6,
                Comment       = "Good enough. Totally recommend",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 6,
                NumberOfStars = 3
            });

            modelBuilder.Entity <Review>().HasData(new Review()
            {
                Id            = 7,
                Comment       = "Not satisfied. Car is not doing well",
                DatePosted    = new DateTime(2021, 02, 20),
                UserId        = 2,
                VehicleId     = 7,
                NumberOfStars = 2
            });
        }
Esempio n. 13
0
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            // CUSTOMER TYPE

            modelBuilder.Entity <CustomerType>().HasData(new CustomerType()
            {
                CustomerTypeId = 1,
                Type           = "Administator"
            });

            modelBuilder.Entity <CustomerType>().HasData(new CustomerType()
            {
                CustomerTypeId = 2,
                Type           = "Korisnik"
            });

            ////CITY

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 1,
                CityName = "Sarajevo",
                PostCode = "71000"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 2,
                CityName = "Mostar",
                PostCode = "88000"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 3,
                CityName = "Travnik",
                PostCode = "72270"
            });

            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 4,
                CityName = "Bugojno",
                PostCode = "70230"
            });


            // CUSTOMER -> Administrator

            Customer c = new Customer
            {
                CustomerId     = 1,
                FirstName      = "Almir",
                LastName       = "Tihak",
                Phone          = "0611111",
                Email          = "*****@*****.**",
                Username       = "******",
                CityId         = 1,
                CustomerTypeId = 1
            };

            c.PasswordSalt = HashGenerator.GenerateSalt();
            c.PasswordHash = HashGenerator.GenerateHash(c.PasswordSalt, "test");
            modelBuilder.Entity <Customer>().HasData(c);

            // CUSTOMER -> Mobile user

            Customer a = new Customer
            {
                CustomerId     = 2,
                FirstName      = "Tester",
                LastName       = "Tester",
                Phone          = "0622222",
                Email          = "*****@*****.**",
                Username       = "******",
                CityId         = 2,
                CustomerTypeId = 2
            };

            a.PasswordSalt = HashGenerator.GenerateSalt();
            a.PasswordHash = HashGenerator.GenerateHash(a.PasswordSalt, "test");
            modelBuilder.Entity <Customer>().HasData(a);

            //BRANCH

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchId    = 1,
                BranchName  = "Kramar",
                PhoneNumber = "255 251",
                Adress      = "Nova Otoka 4",
                OpenTime    = "08:00",
                CloseTime   = "17:00",
                Description = "Dođite i uvjerite se u nas kvalitet.",
                CityId      = 1
            });

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchId    = 2,
                BranchName  = "Buba salon",
                PhoneNumber = "255 252",
                Adress      = "Carinska bb",
                OpenTime    = "08:00",
                CloseTime   = "17:00",
                Description = "Dođite i uvjerite se u nas kvalitet.",
                CityId      = 2
            });

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchId    = 3,
                BranchName  = "Zoom",
                PhoneNumber = "255 253",
                Adress      = "Titova bb",
                OpenTime    = "08:00",
                CloseTime   = "17:00",
                Description = "Dođite i uvjerite se u nas kvalitet.",
                CityId      = 3
            });

            modelBuilder.Entity <Branch>().HasData(new Branch()
            {
                BranchId    = 4,
                BranchName  = "Lijanović salon",
                PhoneNumber = "255 254",
                Adress      = "Nugle 5",
                OpenTime    = "08:00",
                CloseTime   = "17:00",
                Description = "Dođite i uvjerite se u nas kvalitet.",
                CityId      = 4
            });

            //FUEL TYPE

            modelBuilder.Entity <FuelType>().HasData(new FuelType()
            {
                FuelTypeId = 1,
                FuelName   = "Diesel"
            });

            modelBuilder.Entity <FuelType>().HasData(new FuelType()
            {
                FuelTypeId = 2,
                FuelName   = "Benzin"
            });

            modelBuilder.Entity <FuelType>().HasData(new FuelType()
            {
                FuelTypeId = 3,
                FuelName   = "Gas"
            });

            modelBuilder.Entity <FuelType>().HasData(new FuelType()
            {
                FuelTypeId = 4,
                FuelName   = "LPG"
            });

            modelBuilder.Entity <FuelType>().HasData(new FuelType()
            {
                FuelTypeId = 5,
                FuelName   = "Hybrid"
            });

            modelBuilder.Entity <FuelType>().HasData(new FuelType()
            {
                FuelTypeId = 6,
                FuelName   = "Elektro"
            });

            // VEHICLE TYPE

            modelBuilder.Entity <VehicleType>().HasData(new VehicleType()
            {
                VehcileTypeId = 1,
                TypeName      = "Limousine"
            });

            modelBuilder.Entity <VehicleType>().HasData(new VehicleType()
            {
                VehcileTypeId = 2,
                TypeName      = "Caravan"
            });

            modelBuilder.Entity <VehicleType>().HasData(new VehicleType()
            {
                VehcileTypeId = 3,
                TypeName      = "SUV"
            });

            modelBuilder.Entity <VehicleType>().HasData(new VehicleType()
            {
                VehcileTypeId = 4,
                TypeName      = "Sports/Coupe"
            });

            modelBuilder.Entity <VehicleType>().HasData(new VehicleType()
            {
                VehcileTypeId = 5,
                TypeName      = "Off road"
            });

            // MANUFACTURER

            modelBuilder.Entity <Manufacturer>().HasData(new Manufacturer()
            {
                ManufacturerId   = 1,
                ManufacturerName = "Audi"
            });

            modelBuilder.Entity <Manufacturer>().HasData(new Manufacturer()
            {
                ManufacturerId   = 2,
                ManufacturerName = "BMW"
            });

            modelBuilder.Entity <Manufacturer>().HasData(new Manufacturer()
            {
                ManufacturerId   = 3,
                ManufacturerName = "Mercedes-Benz"
            });

            modelBuilder.Entity <Manufacturer>().HasData(new Manufacturer()
            {
                ManufacturerId   = 4,
                ManufacturerName = "Volkswagen"
            });

            modelBuilder.Entity <Manufacturer>().HasData(new Manufacturer()
            {
                ManufacturerId   = 5,
                ManufacturerName = "Porsche"
            });

            modelBuilder.Entity <Manufacturer>().HasData(new Manufacturer()
            {
                ManufacturerId   = 6,
                ManufacturerName = "Citroen"
            });


            //VEHICLEMODEL

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 1,
                ModelName      = "A6",
                ManufacturerId = 1
            });

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 2,
                ModelName      = "A7",
                ManufacturerId = 1
            });

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 3,
                ModelName      = "530d",
                ManufacturerId = 2
            });

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 4,
                ModelName      = "C220",
                ManufacturerId = 3
            });

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 5,
                ModelName      = "Passat",
                ManufacturerId = 4
            });

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 6,
                ModelName      = "Carrera 4S",
                ManufacturerId = 5
            });

            modelBuilder.Entity <VehicleModel>().HasData(new VehicleModel()
            {
                ModelId        = 7,
                ModelName      = "C5",
                ManufacturerId = 6
            });


            // VEHICLES

            // Audi A6
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 1,
                RegistrationNumber = "A11-A-111",
                Image            = File.ReadAllBytes("img/audia6.jpg"),
                VehicleNumber    = 1,
                DailyPrice       = 100,
                Description      = "Audi A6 3.0 TDI Quattro. Vrhunski auto, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2015, 6, 6),
                Mileage          = "170500",
                Transmission     = "Automatik",
                NumberOfSeats    = 5,
                Status           = true,
                BranchId         = 1,
                FuelTypeId       = 1,
                VehicleTypeId    = 1,
                VehicleModelId   = 1
            });

            // Audi A7
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 2,
                RegistrationNumber = "B22-B-222",
                Image            = File.ReadAllBytes("img/audia7.jpg"),
                VehicleNumber    = 2,
                DailyPrice       = 120,
                Description      = "Audi A7 3.0 TFSI Quattro. Vrhunski auto, 300 KS, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2018, 6, 6),
                Mileage          = "100000",
                Transmission     = "Automatik",
                NumberOfSeats    = 5,
                Status           = true,
                BranchId         = 2,
                FuelTypeId       = 2,
                VehicleTypeId    = 4,
                VehicleModelId   = 2
            });

            // BMW 530d
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 3,
                RegistrationNumber = "C33-C-333",
                Image            = File.ReadAllBytes("img/bmw.jpg"),
                VehicleNumber    = 3,
                DailyPrice       = 90,
                Description      = "BMW 530d 258 KS. Vrhunski auto, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2012, 1, 1),
                Mileage          = "100700",
                Transmission     = "Manuleni",
                NumberOfSeats    = 5,
                Status           = true,
                BranchId         = 3,
                FuelTypeId       = 1,
                VehicleTypeId    = 1,
                VehicleModelId   = 3
            });

            // Mercedes c220
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 4,
                RegistrationNumber = "D44-D-444",
                Image            = File.ReadAllBytes("img/mercedes.jpg"),
                VehicleNumber    = 4,
                DailyPrice       = 100,
                Description      = "Mercedes-Benz C220 CDI 170 KS. Vrhunski auto, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2017, 2, 2),
                Mileage          = "170000",
                Transmission     = "Automatik",
                NumberOfSeats    = 5,
                Status           = true,
                BranchId         = 4,
                FuelTypeId       = 1,
                VehicleTypeId    = 2,
                VehicleModelId   = 4
            });

            // Passat 8
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 5,
                RegistrationNumber = "E55-E-555",
                Image            = File.ReadAllBytes("img/passat.jfif"),
                VehicleNumber    = 5,
                DailyPrice       = 100,
                Description      = "Volkswagen Passat 8 170 KS. Vrhunski auto, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2019, 3, 3),
                Mileage          = "10000",
                Transmission     = "Manuelni",
                NumberOfSeats    = 4,
                Status           = true,
                BranchId         = 4,
                FuelTypeId       = 1,
                VehicleTypeId    = 3,
                VehicleModelId   = 5
            });

            // Porsche 4S
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 6,
                RegistrationNumber = "F66-F-666",
                Image            = File.ReadAllBytes("img/porsche.jpg"),
                VehicleNumber    = 6,
                DailyPrice       = 150,
                Description      = "Porsche Carrera 4S 350 KS. Vrhunski auto, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2017, 4, 4),
                Mileage          = "20000",
                Transmission     = "Automatik",
                NumberOfSeats    = 2,
                Status           = true,
                BranchId         = 1,
                FuelTypeId       = 2,
                VehicleTypeId    = 4,
                VehicleModelId   = 6
            });

            // Citroen C5
            modelBuilder.Entity <Vehicle>().HasData(new Vehicle()
            {
                VehicleId          = 7,
                RegistrationNumber = "G77-G-777",
                Image            = File.ReadAllBytes("img/citroen.jpg"),
                VehicleNumber    = 7,
                DailyPrice       = 90,
                Description      = "Citroen C5 150 KS. Vrhunski auto, super ocuvan. Spreman da odgovori na sve vase potrebe.",
                ManufacturerDate = new DateTime(2008, 5, 5),
                Mileage          = "200000",
                Transmission     = "Automatik",
                NumberOfSeats    = 5,
                Status           = true,
                BranchId         = 2,
                FuelTypeId       = 1,
                VehicleTypeId    = 5,
                VehicleModelId   = 7
            });

            // BOOKING

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 1,
                StartDate     = new DateTime(2020, 08, 14),
                EndDate       = new DateTime(2020, 08, 16),
                CustomerId    = 2,
                VehicleId     = 1,
                RatingStatus  = true,
                CommentStatus = true
            });

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 2,
                StartDate     = new DateTime(2020, 08, 01),
                EndDate       = new DateTime(2020, 08, 05),
                CustomerId    = 2,
                VehicleId     = 2,
                RatingStatus  = true,
                CommentStatus = true
            });

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 3,
                StartDate     = new DateTime(2020, 08, 02),
                EndDate       = new DateTime(2020, 08, 10),
                CustomerId    = 2,
                VehicleId     = 3,
                RatingStatus  = true,
                CommentStatus = true
            });

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 4,
                StartDate     = new DateTime(2020, 08, 03),
                EndDate       = new DateTime(2020, 08, 10),
                CustomerId    = 2,
                VehicleId     = 4,
                RatingStatus  = true,
                CommentStatus = true
            });

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 5,
                StartDate     = new DateTime(2020, 08, 05),
                EndDate       = new DateTime(2020, 08, 07),
                CustomerId    = 2,
                VehicleId     = 5,
                RatingStatus  = false,
                CommentStatus = false
            });

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 6,
                StartDate     = new DateTime(2020, 08, 07),
                EndDate       = new DateTime(2020, 08, 10),
                CustomerId    = 2,
                VehicleId     = 6,
                RatingStatus  = false,
                CommentStatus = false
            });

            modelBuilder.Entity <Booking>().HasData(new Booking()
            {
                BookingId     = 7,
                StartDate     = new DateTime(2020, 08, 11),
                EndDate       = new DateTime(2020, 08, 13),
                CustomerId    = 2,
                VehicleId     = 7,
                RatingStatus  = true,
                CommentStatus = true
            });

            // COMMENT

            modelBuilder.Entity <Comment>().HasData(new Comment()
            {
                CommentId     = 1,
                Description   = "Audi A6 je vrhunski auto. Preporučujem ga, sve pohvale.",
                DateOfComment = new DateTime(2020, 08, 10),
                CustomerId    = 2,
                VehicleId     = 1
            });

            modelBuilder.Entity <Comment>().HasData(new Comment()
            {
                CommentId     = 2,
                Description   = "Audi A7 je vrhunski auto. Preporučujem ga, sve pohvale.",
                DateOfComment = new DateTime(2020, 08, 11),
                CustomerId    = 2,
                VehicleId     = 2
            });

            modelBuilder.Entity <Comment>().HasData(new Comment()
            {
                CommentId     = 3,
                Description   = "BMW 530d je vrhunski auto. Preporučujem ga, sve pohvale.",
                DateOfComment = new DateTime(2020, 08, 12),
                CustomerId    = 2,
                VehicleId     = 3
            });

            modelBuilder.Entity <Comment>().HasData(new Comment()
            {
                CommentId     = 4,
                Description   = "Mercede-Benz C220 CDI je vrhunski auto. Preporučujem ga, sve pohvale.",
                DateOfComment = new DateTime(2020, 08, 12),
                CustomerId    = 2,
                VehicleId     = 4
            });

            //modelBuilder.Entity<Comment>().HasData(new Comment()
            //{
            //    CommentId = 5,
            //    Description = "Volkswagen Passat 8 je vrhunski auto. Preporučujem ga, sve pohvale.",
            //    DateOfComment = new DateTime(2020, 08, 13),
            //    CustomerId = 2,
            //    VehicleId = 5
            //});

            //modelBuilder.Entity<Comment>().HasData(new Comment()
            //{
            //    CommentId = 6,
            //    Description = "Porsche Carrera 4S je vrhunski auto. Preporučujem ga, sve pohvale.",
            //    DateOfComment = new DateTime(2020, 08, 14),
            //    CustomerId = 2,
            //    VehicleId = 6
            //});

            modelBuilder.Entity <Comment>().HasData(new Comment()
            {
                CommentId     = 7,
                Description   = "Citroen C5 HDI je vrhunski auto. Preporučujem ga, sve pohvale.",
                DateOfComment = new DateTime(2020, 08, 15),
                CustomerId    = 2,
                VehicleId     = 7
            });

            // RATING

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingId    = 1,
                RatingValue = 9,
                CustomerId  = 2,
                VehicleId   = 1,
                RatingDate  = new DateTime(2020, 08, 10)
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingId    = 2,
                RatingValue = 10,
                CustomerId  = 2,
                VehicleId   = 2,
                RatingDate  = new DateTime(2020, 08, 11)
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingId    = 3,
                RatingValue = 7,
                CustomerId  = 2,
                VehicleId   = 3,
                RatingDate  = new DateTime(2020, 08, 12)
            });

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingId    = 4,
                RatingValue = 5,
                CustomerId  = 2,
                VehicleId   = 4,
                RatingDate  = new DateTime(2020, 08, 13)
            });

            //modelBuilder.Entity<Rating>().HasData(new Rating()
            //{
            //    RatingId = 5,
            //    RatingValue = 6,
            //    CustomerId = 2,
            //    VehicleId = 5,
            //    RatingDate = new DateTime(2020, 08, 14)
            //});

            //modelBuilder.Entity<Rating>().HasData(new Rating()
            //{
            //    RatingId = 6,
            //    RatingValue = 7,
            //    CustomerId = 2,
            //    VehicleId = 6,
            //    RatingDate = new DateTime(2020, 08, 15)
            //});

            modelBuilder.Entity <Rating>().HasData(new Rating()
            {
                RatingId    = 7,
                RatingValue = 4,
                CustomerId  = 2,
                VehicleId   = 5,
                RatingDate  = new DateTime(2020, 08, 16)
            });
        }
        private void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity <HairdresserSalon>().HasData
            (
                new HairdresserSalon
            {
                Id      = 1,
                Salon   = "Fare barbershop Bugojno",
                Email   = "*****@*****.**",
                Phone   = "063907678",
                Address = "Sultan Ahmedova II",
                Logo    = File.ReadAllBytes("Images/logo.jpg")
            }
            );

            modelBuilder.Entity <Role>().HasData
            (
                new Role
            {
                Id          = 1,
                Description = "Admin"
            },
                new Role
            {
                Id          = 2,
                Description = "Client"
            }
            );

            modelBuilder.Entity <Notification>().HasData
            (
                new Notification
            {
                Id                 = 1,
                Title              = "Neradni dani",
                Text               = "Povodom dana državnosti 25.11.2021. Vaš frizerski salon Fare neće raditi.",
                NotificationDate   = new DateTime(2021, 11, 24),
                HairdresserSalonId = 1
            },
                new Notification
            {
                Id                 = 2,
                Title              = "Bajramska čestitka",
                Text               = "Puno zdravlja, sreće i uspjeha u životu povodom predstojećih praznika uz riječi Bajram Šerif Mubarek Olsun želi Vam Vaš frizerski salon Fare.",
                NotificationDate   = new DateTime(2021, 08, 14),
                HairdresserSalonId = 1
            }
            );

            modelBuilder.Entity <Sponsor>().HasData
            (
                new Sponsor
            {
                Id                 = 1,
                SponsorName        = "Pizzeria AKO",
                HairdresserSalonId = 1,
                About              = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
                Email              = "*****@*****.**",
                Phone              = "033221212",
                Logo               = File.ReadAllBytes("Images/akoo.jpg")
            },
                new Sponsor
            {
                Id                 = 2,
                SponsorName        = "Caffe TWO",
                HairdresserSalonId = 1,
                About              = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
                Email              = "*****@*****.**",
                Phone              = "033224982",
                Logo               = File.ReadAllBytes("Images/two.jpg")
            }
            );

            modelBuilder.Entity <Associate>().HasData
            (
                new Associate
            {
                Id                 = 1,
                AssociateName      = "DM Bugojno",
                Email              = "*****@*****.**",
                Phone              = "030226711",
                HairdresserSalonId = 1
            },
                new Associate
            {
                Id                 = 2,
                AssociateName      = "Frizerland BiH",
                Email              = "*****@*****.**",
                Phone              = "0302219801",
                HairdresserSalonId = 1
            }
            );

            User admin = new User
            {
                Id        = 1,
                FirstName = "admin",
                LastName  = "admin",
                Email     = "*****@*****.**",
                Phone     = "030222111",
                Username  = "******",
                Image     = File.ReadAllBytes("Images/default-pic.png"),
                RoleId    = 1
            };

            admin.PasswordSalt = HashGenerator.GenerateSalt();
            admin.PasswordHash = HashGenerator.GenerateHash(admin.PasswordSalt, "Admin1234!");

            User user1 = new User
            {
                Id        = 2,
                FirstName = "User1",
                LastName  = "User1",
                Email     = "*****@*****.**",
                Phone     = "030222112",
                Username  = "******",
                Image     = File.ReadAllBytes("Images/default-pic.png"),
                RoleId    = 2
            };

            user1.PasswordSalt = HashGenerator.GenerateSalt();
            user1.PasswordHash = HashGenerator.GenerateHash(user1.PasswordSalt, "User11234!");

            User user2 = new User
            {
                Id        = 3,
                FirstName = "User2",
                LastName  = "User2",
                Email     = "*****@*****.**",
                Phone     = "030222113",
                Username  = "******",
                Image     = File.ReadAllBytes("Images/default-pic.png"),
                RoleId    = 2
            };

            user2.PasswordSalt = HashGenerator.GenerateSalt();
            user2.PasswordHash = HashGenerator.GenerateHash(user2.PasswordSalt, "User21234!");

            User user3 = new User
            {
                Id        = 4,
                FirstName = "User3",
                LastName  = "User3",
                Email     = "*****@*****.**",
                Phone     = "030222114",
                Username  = "******",
                Image     = File.ReadAllBytes("Images/default-pic.png"),
                RoleId    = 2
            };

            user3.PasswordSalt = HashGenerator.GenerateSalt();
            user3.PasswordHash = HashGenerator.GenerateHash(user3.PasswordSalt, "User31234!");

            User user4 = new User
            {
                Id        = 5,
                FirstName = "User4",
                LastName  = "User4",
                Email     = "*****@*****.**",
                Phone     = "030222115",
                Username  = "******",
                Image     = File.ReadAllBytes("Images/default-pic.png"),
                RoleId    = 2
            };

            user4.PasswordSalt = HashGenerator.GenerateSalt();
            user4.PasswordHash = HashGenerator.GenerateHash(user4.PasswordSalt, "User41234!");
            modelBuilder.Entity <User>().HasData(admin);
            modelBuilder.Entity <User>().HasData(user1);
            modelBuilder.Entity <User>().HasData(user2);
            modelBuilder.Entity <User>().HasData(user3);
            modelBuilder.Entity <User>().HasData(user4);

            modelBuilder.Entity <Hairdresser>().HasData
            (
                new Hairdresser
            {
                Id        = 1,
                FirstName = "Faruk",
                LastName  = "Omanović",
                BirthDate = new DateTime(1990, 02, 24),
                PersonalIdentificationNumber = "1234567891876",
                Phone              = "062442221",
                Email              = "*****@*****.**",
                Salary             = 1500,
                Image              = File.ReadAllBytes("Images/Frizer1.jpg"),
                HairdresserSalonId = 1,
                Available          = true
            },
                new Hairdresser
            {
                Id        = 2,
                FirstName = "Kenan",
                LastName  = "Mustafica",
                BirthDate = new DateTime(1995, 02, 17),
                PersonalIdentificationNumber = "1234567891316",
                Phone              = "062442233",
                Email              = "*****@*****.**",
                Salary             = 1300,
                Image              = File.ReadAllBytes("Images/frizer2.jpg"),
                HairdresserSalonId = 1,
                Available          = true
            },
                new Hairdresser
            {
                Id        = 3,
                FirstName = "Sulejman",
                LastName  = "Mehić",
                BirthDate = new DateTime(1990, 05, 24),
                PersonalIdentificationNumber = "1234017891876",
                Phone              = "062442443",
                Email              = "*****@*****.**",
                Salary             = 1000,
                Image              = File.ReadAllBytes("Images/frizer3.jpg"),
                HairdresserSalonId = 1,
                Available          = true
            },
                new Hairdresser
            {
                Id        = 4,
                FirstName = "Emir",
                LastName  = "Crnkić",
                BirthDate = new DateTime(1999, 09, 04),
                PersonalIdentificationNumber = "3214567891876",
                Phone              = "0624412221",
                Email              = "*****@*****.**",
                Salary             = 700,
                Image              = File.ReadAllBytes("Images/emir-frize.jpg"),
                HairdresserSalonId = 1,
                Available          = true
            }
            );

            modelBuilder.Entity <Hairstyle>().HasData
            (
                new Hairstyle
            {
                Id            = 1,
                HairstyleName = "Skin fade",
                Description   = "A skin fade is achieved by cutting the hair shorter and shorter as it moves toward the neck. Whereas some haircuts require the hair to be the same length all around the head," +
                                "skin fade haircuts demand the hair to be cut at decreasing lengths.",
                Price = 7,
                DurationOfProduction = 20,
                Image = File.ReadAllBytes("Images/skin fade.jpg")
            },
                new Hairstyle
            {
                Id                   = 2,
                HairstyleName        = "Short hairstyle",
                Description          = "Short hair refers to any haircut with little length. It may vary from above the ears to below the chin. If a man's hair reaches the chin, it may not be considered short. For a woman, however, short varies from close-cropped to just above the shoulders.",
                Price                = 5,
                DurationOfProduction = 15,
                Image                = File.ReadAllBytes("Images/short-hairstyle.jpg")
            },
                new Hairstyle
            {
                Id                   = 3,
                HairstyleName        = "Medium hairstyle",
                Description          = "Medium length – also known as mid-length hair – is having a moment. ... In general, a medium-cut sees the ends of your hair at your collarbones or your shoulder blades. This type of hairstyle works with all hair types – from straight to wavy, curly, and natural – as well as all hair textures.",
                Price                = 10,
                DurationOfProduction = 20,
                Image                = File.ReadAllBytes("Images/medium-hairstyle.jpg")
            },
                new Hairstyle
            {
                Id                   = 4,
                HairstyleName        = "Beard trimming",
                Description          = "The best way to trim your beard is to start with the longest hair length and bring it down gradually. Set your beard trimmer to its longest setting and trim your beard all over. Go against the direction of hair growth to remove excess bulk. Repeat using shorter trim settings until you're happy with the length.",
                Price                = 3,
                DurationOfProduction = 5,
                Image                = File.ReadAllBytes("Images/beard-trimming.jpg")
            },
                new Hairstyle
            {
                Id                   = 5,
                HairstyleName        = "Hair coloring",
                Description          = "Long hair affords the wearer far more variety than shorter styles. You can wear your hair straight and smooth, wild and wavy, half up, half down, pinned, in braids – the options are endless. This versatility is attractive to men. Experimenting with your style demonstrates adventure and excitement.",
                Price                = 20,
                DurationOfProduction = 40,
                Image                = File.ReadAllBytes("Images/hairstyle coloring.jpg")
            },
                new Hairstyle
            {
                Id                   = 6,
                HairstyleName        = "Long hairstyle",
                Description          = "Hair coloring, or hair dyeing, is the practice of changing the hair color. The main reasons for this are cosmetic: to cover gray or white hair, to change to a color regarded as more fashionable or desirable, or to restore the original hair color after it has been discolored by hairdressing processes or sun bleaching.",
                Price                = 12,
                DurationOfProduction = 30,
                Image                = File.ReadAllBytes("Images/long-hairstyle.jpg")
            }
            );

            modelBuilder.Entity <HairdresserHairstyle>().HasData
            (
                new HairdresserHairstyle
            {
                HairdresserId = 1,
                HairstyleId   = 1
            },
                new HairdresserHairstyle
            {
                HairdresserId = 1,
                HairstyleId   = 2
            },
                new HairdresserHairstyle
            {
                HairdresserId = 1,
                HairstyleId   = 3
            },
                new HairdresserHairstyle
            {
                HairdresserId = 1,
                HairstyleId   = 4
            },
                new HairdresserHairstyle
            {
                HairdresserId = 1,
                HairstyleId   = 6
            },
                new HairdresserHairstyle
            {
                HairdresserId = 2,
                HairstyleId   = 2
            },
                new HairdresserHairstyle
            {
                HairdresserId = 2,
                HairstyleId   = 1
            },
                new HairdresserHairstyle
            {
                HairdresserId = 2,
                HairstyleId   = 5
            },
                new HairdresserHairstyle
            {
                HairdresserId = 2,
                HairstyleId   = 4
            },
                new HairdresserHairstyle
            {
                HairdresserId = 3,
                HairstyleId   = 1
            },
                new HairdresserHairstyle
            {
                HairdresserId = 3,
                HairstyleId   = 2
            },
                new HairdresserHairstyle
            {
                HairdresserId = 3,
                HairstyleId   = 4
            },
                new HairdresserHairstyle
            {
                HairdresserId = 4,
                HairstyleId   = 1
            }, new HairdresserHairstyle
            {
                HairdresserId = 4,
                HairstyleId   = 2
            }, new HairdresserHairstyle
            {
                HairdresserId = 4,
                HairstyleId   = 3
            },
                new HairdresserHairstyle
            {
                HairdresserId = 4,
                HairstyleId   = 4
            }
            );

            modelBuilder.Entity <Comment>().HasData
            (
                new Comment
            {
                Id     = 1,
                Text   = "Sve pohvale za Faruka.",
                UserId = 2,
                Date   = new DateTime(2021, 04, 17, 10, 30, 00)
            },
                new Comment
            {
                Id     = 2,
                Text   = "Odlična usluga i pristup frizera, samo malo prevruće u salonu :)",
                UserId = 3,
                Date   = new DateTime(2021, 04, 10, 14, 10, 00)
            }
            );

            modelBuilder.Entity <Booking>().HasData
            (
                new Booking
            {
                Id            = 1,
                UserId        = 2,
                HairdresserId = 1,
                HairstyleId   = 1,
                StartDate     = new DateTime(2021, 04, 05, 09, 00, 00),
                EndDate       = new DateTime(2021, 04, 05, 09, 20, 00)
            },
                new Booking
            {
                Id            = 2,
                UserId        = 2,
                HairdresserId = 2,
                HairstyleId   = 2,
                StartDate     = new DateTime(2021, 04, 06, 09, 00, 00),
                EndDate       = new DateTime(2021, 04, 06, 09, 20, 00)
            },
                new Booking
            {
                Id            = 3,
                UserId        = 4,
                HairdresserId = 3,
                HairstyleId   = 4,
                StartDate     = new DateTime(2021, 04, 15, 09, 00, 00),
                EndDate       = new DateTime(2021, 04, 15, 09, 20, 00)
            },
                new Booking
            {
                Id            = 4,
                UserId        = 2,
                HairdresserId = 2,
                HairstyleId   = 5,
                StartDate     = new DateTime(2021, 04, 05, 09, 00, 00),
                EndDate       = new DateTime(2021, 04, 05, 09, 20, 00)
            },
                new Booking
            {
                Id            = 5,
                UserId        = 4,
                HairdresserId = 4,
                HairstyleId   = 4,
                StartDate     = new DateTime(2021, 04, 03, 09, 00, 00),
                EndDate       = new DateTime(2021, 04, 03, 09, 20, 00)
            },
                new Booking
            {
                Id            = 6,
                UserId        = 3,
                HairdresserId = 2,
                HairstyleId   = 6,
                StartDate     = new DateTime(2021, 04, 01, 09, 00, 00),
                EndDate       = new DateTime(2021, 04, 01, 09, 20, 00)
            }
            );

            modelBuilder.Entity <Payment>().HasData
            (
                new Payment
            {
                Id             = 1,
                PaymentDate    = new DateTime(2021, 04, 08),
                Amount         = 7,
                BankCardNumber = "12035627651",
                UserId         = 2
            },
                new Payment
            {
                Id             = 2,
                PaymentDate    = new DateTime(2021, 04, 10),
                Amount         = 20,
                BankCardNumber = "12035609651",
                UserId         = 3
            },
                new Payment
            {
                Id             = 3,
                PaymentDate    = new DateTime(2021, 03, 04),
                Amount         = 7,
                BankCardNumber = "12035627671",
                UserId         = 3
            },
                new Payment
            {
                Id             = 4,
                PaymentDate    = new DateTime(2021, 04, 10),
                Amount         = 10,
                BankCardNumber = "12035627622",
                UserId         = 2
            },
                new Payment
            {
                Id             = 5,
                PaymentDate    = new DateTime(2021, 04, 14),
                Amount         = 3,
                BankCardNumber = "12035627601",
                UserId         = 4
            }
            );

            modelBuilder.Entity <Rating>().HasData
            (
                new Rating
            {
                Id            = 1,
                UserId        = 2,
                HairdresserId = 1,
                Rate          = 5
            },
                new Rating
            {
                Id            = 2,
                UserId        = 2,
                HairdresserId = 1,
                Rate          = 5
            },
                new Rating
            {
                Id            = 3,
                UserId        = 4,
                HairdresserId = 2,
                Rate          = 4
            },
                new Rating
            {
                Id            = 4,
                UserId        = 4,
                HairdresserId = 1,
                Rate          = 4
            },
                new Rating
            {
                Id            = 5,
                UserId        = 3,
                HairdresserId = 3,
                Rate          = 5
            },
                new Rating
            {
                Id            = 6,
                UserId        = 3,
                HairdresserId = 2,
                Rate          = 5
            }
            );
        }
Esempio n. 15
0
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Role>().HasData(new Role()
            {
                RoleId   = 1,
                RoleName = "Administrator"
            });

            modelBuilder.Entity <Role>().HasData(new Role()
            {
                RoleId   = 2,
                RoleName = "Visitor"
            });
            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 1,
                CityName = "Bugojno"
            });
            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 2,
                CityName = "Mostar"
            });
            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 3,
                CityName = "Sarajevo"
            });
            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 4,
                CityName = "Donji Vakuf"
            });
            modelBuilder.Entity <City>().HasData(new City()
            {
                CityId   = 5,
                CityName = "Tuzla"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 1,
                Description    = "Popust na svu hranu"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 2,
                Description    = "Popust na sva pića"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 3,
                Description    = "Popust na predjela"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 4,
                Description    = "Popust na glavna jela"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 5,
                Description    = "Popust na mesne plate"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 6,
                Description    = "Popust na salate"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 7,
                Description    = "Popust na deserte"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 8,
                Description    = "Popust na negazirane sokove"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 9,
                Description    = "Popust na gazirane sokove"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 10,
                Description    = "Popust na cijeđene sokove"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 11,
                Description    = "Popust na vodu"
            });
            modelBuilder.Entity <DiscountType>().HasData(new DiscountType()
            {
                DiscountTypeId = 12,
                Description    = "Popust na pojedinačnu stavku"
            });
            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderId = 1,
                Gender1  = "Muško"
            });
            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderId = 2,
                Gender1  = "Žensko"
            });
            modelBuilder.Entity <Gender>().HasData(new Gender()
            {
                GenderId = 3,
                Gender1  = "Ne želim reći"
            });
            modelBuilder.Entity <ItemType>().HasData(new ItemType()
            {
                ItemTypeId = 1,
                Type       = "Hrana"
            });
            modelBuilder.Entity <ItemType>().HasData(new ItemType()
            {
                ItemTypeId = 2,
                Type       = "Pića"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 1,
                ItemTypeId     = 1,
                Category       = "Predjela"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 2,
                ItemTypeId     = 1,
                Category       = "Glavna jela"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 3,
                ItemTypeId     = 1,
                Category       = "Deserti"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 5,
                ItemTypeId     = 1,
                Category       = "Salate"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 6,
                ItemTypeId     = 1,
                Category       = "Mesne plate"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 7,
                ItemTypeId     = 2,
                Category       = "Negazirani sokovi"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 8,
                ItemTypeId     = 2,
                Category       = "Gazirani sokovi"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 10,
                ItemTypeId     = 2,
                Category       = "Cijeđeni sokovi"
            });
            modelBuilder.Entity <ItemCategory>().HasData(new ItemCategory()
            {
                ItemCategoryId = 11,
                ItemTypeId     = 2,
                Category       = "Voda"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 1,
                Description = "Đački (5 komada)",
                Mark        = "ĆE"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 2,
                Description = "Mali (10 komada)",
                Mark        = "ĆE"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 3,
                Description = "Srednji (15 komada)",
                Mark        = "ĆE"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 4,
                Description = "Veliki (20 komada)",
                Mark        = "ĆE"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 5,
                Description = "Mala",
                Mark        = "PI"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 6,
                Description = "Srednja",
                Mark        = "PI"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 7,
                Description = "Velika",
                Mark        = "PI"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 8,
                Description = "Male",
                Mark        = "PLj-SU"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 9,
                Description = "Velike",
                Mark        = "PLj-SU"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 10,
                Description = "1 komad",
                Mark        = "KOL"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 11,
                Description = "0,25L",
                Mark        = "SOK"
            });
            modelBuilder.Entity <Quantity>().HasData(new Quantity()
            {
                QuantityId  = 12,
                Description = "0,5L",
                Mark        = "VOD"
            });
            modelBuilder.Entity <Restaurant>().HasData(new Restaurant()
            {
                RestaurantId   = 1,
                RestaurantName = "Restoran FIT",
                CityId         = 2,
                Address        = "Sjeverni logor, broj 8",
                NumberOfTables = 15,
                OpenAt         = new DateTime(2020, 08, 11, 08, 00, 00),
                CloseAt        = new DateTime(2020, 08, 11, 22, 00, 00),
                Image          = File.ReadAllBytes("img/restaurant.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 1,
                ItemName             = "Ćevapi",
                Price          = 5,
                ItemCategoryId = 2,
                QuantityId     = 2,
                Image          = File.ReadAllBytes("img/chevapi.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 2,
                ItemName             = "Cijeđena narandža",
                Price          = 3,
                ItemCategoryId = 10,
                QuantityId     = 12,
                Image          = File.ReadAllBytes("img/cnarana.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 3,
                ItemName             = "Mesna plata (Classic)",
                Price          = 17,
                ItemCategoryId = 6,
                QuantityId     = 6,
                Image          = File.ReadAllBytes("img/mplata.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 4,
                ItemName             = "Pizza Margherita",
                Price          = 4,
                ItemCategoryId = 2,
                QuantityId     = 5,
                Image          = File.ReadAllBytes("img/pizzam.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 5,
                ItemName             = "Nutella torta",
                Price          = 3,
                ItemCategoryId = 3,
                QuantityId     = 10,
                Image          = File.ReadAllBytes("img/nutellac.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 6,
                ItemName             = "Cheesecake",
                Price          = 3,
                ItemCategoryId = 3,
                QuantityId     = 10,
                Image          = File.ReadAllBytes("img/cheesecake.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 7,
                ItemName             = "Paradajz juha",
                Price          = 3,
                ItemCategoryId = 1,
                QuantityId     = 6,
                Image          = File.ReadAllBytes("img/pjuha.jpg")
            });
            modelBuilder.Entity <RestaurantMenuItem>().HasData(new RestaurantMenuItem()
            {
                RestaurantMenuItemId = 8,
                ItemName             = "Omlet",
                Price          = 2,
                ItemCategoryId = 1,
                QuantityId     = 10,
                Image          = File.ReadAllBytes("img/omlet.jpg")
            });

            //desktop

            User u1 = new User
            {
                UserId      = 1,
                Name        = "Desktop",
                Surname     = "User",
                DateOfBirth = new DateTime(1999, 01, 13),
                CityId      = 4,
                Address     = "Prusac b.b.",
                PhoneNumber = "062357889",
                GenderId    = 1,
                Username    = "******"
            };

            u1.PasswordSalt = HashGenerator.GenerateSalt();
            u1.PasswordHash = HashGenerator.GenerateHash(u1.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u1);


            //visitor

            User u2 = new User
            {
                UserId      = 2,
                Name        = "Mobile",
                Surname     = "User",
                DateOfBirth = new DateTime(1999, 02, 21),
                CityId      = 5,
                Address     = "Mobilna br. 4",
                PhoneNumber = "062907219",
                GenderId    = 1,
                Username    = "******"
            };

            u2.PasswordSalt = HashGenerator.GenerateSalt();
            u2.PasswordHash = HashGenerator.GenerateHash(u2.PasswordSalt, "test");
            modelBuilder.Entity <User>().HasData(u2);

            modelBuilder.Entity <UserRole>().HasData(new UserRole()
            {
                UserRoleId = 1,
                UserId     = 1,
                RoleId     = 1
            });
            modelBuilder.Entity <UserRole>().HasData(new UserRole()
            {
                UserRoleId = 2,
                UserId     = 2,
                RoleId     = 2
            });

            modelBuilder.Entity <Award>().HasData(new Award()
            {
                AwardId     = 1,
                UserId      = 2,
                Description = "Besplatan bilo koji proizvod iz kategorije glavnih jela",
                Active      = true,
                AwardDate   = new DateTime(2020, 05, 06, 09, 00, 00)
            });

            modelBuilder.Entity <Discount>().HasData(new Discount()
            {
                DiscountId     = 1,
                UserId         = 2,
                DiscountTypeId = 1,
                ItemTypeId     = 1,
                DiscountDate   = new DateTime(2020, 05, 06, 09, 00, 00),
                Active         = true,
                DiscountValue  = Convert.ToDecimal(0.20)
            });
            modelBuilder.Entity <MenuItemsReview>().HasData(new MenuItemsReview()
            {
                MenuItemsReviewId    = 1,
                UserId               = 2,
                RestaurantMenuItemId = 1,
                Description          = "Jako ukusni ćevapi. Lepina bi samo mogla biti malo sočnija, sve u svemu super!",
                Grade = 4
            });
            modelBuilder.Entity <RestaurantReview>().HasData(new RestaurantReview()
            {
                RestaurantReviewId = 1,
                UserId             = 2,
                Description        = "Sve najbolje za restoran. Vrlo ljubazno osoblje i ugodan ambijent!",
                Grade = 5
            });
            modelBuilder.Entity <Visit>().HasData(new Visit()
            {
                VisitId     = 1,
                UserId      = 2,
                DateOfVisit = new DateTime(2020, 05, 06, 09, 00, 00)
            });
            modelBuilder.Entity <Visit>().HasData(new Visit()
            {
                VisitId     = 2,
                UserId      = 2,
                DateOfVisit = new DateTime(2020, 06, 07, 19, 20, 00)
            });
            modelBuilder.Entity <VisitorRecommendation>().HasData(new VisitorRecommendation()
            {
                VisitorRecommendationId = 1,
                UserId = 2,
                RecommendationDescription = "Preporuka za promjenu muzike, ova je dosta monotona"
            });
            modelBuilder.Entity <Key>().HasData(new Key()
            {
                KeyId  = 1,
                Key1   = 123456789,
                Active = true
            });
            modelBuilder.Entity <Key>().HasData(new Key()
            {
                KeyId = 2,

                Key1   = 987654321,
                Active = true
            });
            modelBuilder.Entity <Key>().HasData(new Key()
            {
                KeyId = 3,

                Key1   = 123789456,
                Active = true
            });
            modelBuilder.Entity <Key>().HasData(new Key()
            {
                KeyId = 4,

                Key1   = 789123456,
                Active = true
            });
            modelBuilder.Entity <Key>().HasData(new Key()
            {
                KeyId = 5,

                Key1   = 258963147,
                Active = true
            });
            modelBuilder.Entity <Key>().HasData(new Key()
            {
                KeyId = 6,

                Key1   = 147258369,
                Active = true
            });
        }