public Lease(int Id, DateTime start, DateTime expectedReturm, DateTime actualReturn, User user, Copy copy,
     Fine fine)
 {
     this.Id = Id;
     this.StartDate = start;
     this.ExpectedReturn = expectedReturm;
     this.ActualReturn = actualReturn;
     this.User = user;
     this.Copy = copy;
     this.Fine = fine;
 }
        public static User UpdateUser(Dictionary<string, object> propertiesMap, User currentUser)
        {
            var address = propertiesMap["address"] as Address;
            var legal = propertiesMap["legal"] as LegalInformation;
            currentUser.Email = (string) propertiesMap["email"];
            currentUser.Password = (propertiesMap.ContainsKey("password") == true)
                ? (string) propertiesMap["password"]
                : currentUser.Password;
            currentUser.PhoneNumber = (string) propertiesMap["phoneNumber"];
            currentUser.IsRegistered = (bool) propertiesMap["isRegistered"];
            currentUser.Role = (Role) propertiesMap["role"];
            currentUser.UserName = (string) propertiesMap["email"];
            currentUser.AddressLine = address.AddressLine;
            currentUser.PostalCode = address.PostalCode;
            currentUser.City = new City() {Country = address.Country, Name = address.City, State = address.State};
            currentUser.Name = legal.Name;
            currentUser.Surname = legal.Surname;
            currentUser.PESEL = legal.PESEL;

            return currentUser;
        }
        public static SpecifySchedule For(User user)
        {
            var defaultTableForUser = TimetableRepo.GetByQuery(t => t.User.Id == user.Id).First();

            return new SpecifySchedule(OverridesRepo, defaultTableForUser);
        }