diff options
-rw-r--r-- | ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs index e5ca71e..1f291c9 100644 --- a/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs @@ -1,28 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ApartmentManager.Model; -namespace ApartmentManager.Model +namespace ApartmentManager.Singletons { public class UserSingleton { - private static UserSingleton instance; + private static UserSingleton _instance; + public static UserSingleton Instance => _instance ?? (_instance = new UserSingleton()); + public User CurrentUser { get; set; } private UserSingleton() { } - - public static UserSingleton Instance - { - get - { - if (instance == null) - { - instance = new UserSingleton(); - } - return instance; - } - } } } |