Ejemplo n.º 1
0
        /// <summary>
        /// Removes a client based on the GUID property and .
        /// </summary>
        public void UnRegister(string guid, string password)
        {
            using (AuraContext database = new AuraContext())
            {
                var user = database.Clients.FirstOrDefault(client => client.GUID == guid);

                if (user != null)
                {
                    if (user.Password == password)
                    {
                        ServerLogger.Warning($"Removing a user: {user.FullName} ({user.GUID})");
                        database.Clients.Remove(user);

                        ServerLogger.Important($"Removed {user.FullName} from Aura.");
                        database.SaveChanges();
                    }
                }
            }
        }