Example #1
0
        static void Main(string[] args)
        {
            var builder = new ContainerBuilder();
            builder.RegisterType<PhotoArkContext>().As<IPhotoArkContext>();
            builder.RegisterType<UserService>().As<IUserService>();

            var container = builder.Build();

            using (var scope = container.BeginLifetimeScope())
            {
                var ctx = scope.Resolve<IPhotoArkContext>();
                IUserService userService = scope.Resolve<IUserService>();

                var user = new User()
                {
                    UserName = "******",
                    Email = "*****@*****.**",
                    UserDetail = new UserDetail()
                };

                var user2 = new User()
                {
                    UserName = "******",
                    Email = "*****@*****.**",
                    UserDetail = new UserDetail()
                };
                userService.Create(user);

            }
        }
Example #2
0
 public static User CreateNewUser(string email, string userName)
 {
     var userDetails = new UserDetail();
     var user = new User()
     {
         UserName = userName,
         Email = email,
         Authenticated = false,
         AuthenticationString = new Guid(),
         UserDetail = userDetails,
     };
     return user;
 }
Example #3
0
 protected bool Equals(User other)
 {
     return string.Equals(UserName, other.UserName, StringComparison.OrdinalIgnoreCase) && string.Equals(Email, other.Email, StringComparison.OrdinalIgnoreCase);
 }