Example #1
0
        private static async Task Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            IEventAggregator eventAggregator = new EventAggregator();

            UserModel userModel = new()
            {
                FirstName = "Kishor",
                LastName  = "Naik",
                EmailId   = "*****@*****.**"
            };

            IUserRepository userRepository = new UserRepository(eventAggregator);
            IUserContext    userContext    = new UserContext(eventAggregator, userRepository);

            bool flag = await userContext.AddUserAsync(userModel);

            Console.WriteLine((flag == true) ? "Save" : "something went wrong");
        }
    }
Example #2
0
 public async Task AddUserAsync(User user)
 {
     await _userContext.AddUserAsync(user);
 }