Inheritance: System.Data.Objects.DataClasses.EntityObject
 protected void Fetch(User user, BusinessIdentityData data)
 {
     data.UserId = user.UserId;
     data.Name = user.Name;
     data.Salt = user.Salt;
     data.Password = user.Password;
 }
Esempio n. 2
0
        public UserData Insert(UserData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var user = new User();

                DataMapper.Map(data, user);

                ctx.ObjectContext.AddToUsers(user);

                ctx.ObjectContext.SaveChanges();

                data.UserId = user.UserId;

                return data;
            }
        }
Esempio n. 3
0
 private void Fetch(User user, UserData userData)
 {
     DataMapper.Map(user, userData);
 }
Esempio n. 4
0
        public UserData Update(UserData userData)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var user =
                    new User
                    {
                        UserId = userData.UserId
                    };

                ctx.ObjectContext.Users.Attach(user);

                DataMapper.Map(userData, user);

                ctx.ObjectContext.SaveChanges();

                return userData;
            }
        }
 /// <summary>
 /// Create a new User object.
 /// </summary>
 /// <param name="userId">Initial value of the UserId property.</param>
 /// <param name="email">Initial value of the Email property.</param>
 /// <param name="fullName">Initial value of the FullName property.</param>
 /// <param name="isActive">Initial value of the IsActive property.</param>
 /// <param name="isArchived">Initial value of the IsArchived property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="password">Initial value of the Password property.</param>
 /// <param name="salt">Initial value of the Salt property.</param>
 /// <param name="token">Initial value of the Token property.</param>
 /// <param name="tokenExpirationDate">Initial value of the TokenExpirationDate property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static User CreateUser(global::System.Int32 userId, global::System.String email, global::System.String fullName, global::System.Boolean isActive, global::System.Boolean isArchived, global::System.String name, global::System.String password, global::System.String salt, global::System.String token, global::System.DateTime tokenExpirationDate, global::System.DateTime createdDate, global::System.DateTime modifiedDate)
 {
     User user = new User();
     user.UserId = userId;
     user.Email = email;
     user.FullName = fullName;
     user.IsActive = isActive;
     user.IsArchived = isArchived;
     user.Name = name;
     user.Password = password;
     user.Salt = salt;
     user.Token = token;
     user.TokenExpirationDate = tokenExpirationDate;
     user.CreatedDate = createdDate;
     user.ModifiedDate = modifiedDate;
     return user;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers(User user)
 {
     base.AddObject("Users", user);
 }
Esempio n. 7
0
 internal static void Map(UserData source, User destination)
 {
     destination.UserId = source.UserId;
     destination.Name = source.Name;
     destination.Email = source.Email;
     destination.Salt = source.Salt;
     destination.Password = source.Password;
     destination.Token = source.Token;
     destination.TokenExpirationDate = source.TokenExpirationDate;
     destination.IsActive = source.IsActive;
     destination.ModifiedDate = source.ModifiedDate;
     destination.CreatedDate = source.CreatedDate;
 }