public void AddAdministrator(Administrator administrator) { using (MD5 md5Hash = MD5.Create()) { administrator.Password = GetMd5Hash(md5Hash, administrator.Password); } _administratorRepository.Add(administrator); }
public void IsAnyAdministratorExist() { var administrators = _administratorRepository.GetQuery(); if (!administrators.Any()) { var administrator = new Administrator { Login = "******", Email = "*****@*****.**", Password = "******", CreatedOn = DateTime.Now }; AddAdministrator(administrator); Save(); } }