public CreateSomeDataCommand BuildCreateSomeDataCommand(ApplicationUserId applicationUserId)
 {
     return(new CreateSomeDataCommand(id,
                                      firstName,
                                      middleName,
                                      lastName, title,
                                      new Color(color),
                                      creationDate,
                                      new FacebookUrl(facebookUrl),
                                      applicationUserId));
 }
Exemplo n.º 2
0
        public ApplicationUser()
        {
            ApplicationUserId = _nextId;
            StringId          = ApplicationUserId.ToString();
            _nextId++;
            PermissionLevels = new List <SelectListItem>();

            foreach (var name in Enum.GetValues(typeof(Permissions)))
            {
                PermissionLevels.Add(new SelectListItem()
                {
                    Value = ((int)name).ToString(),
                    Text  = name.ToString()
                });
            }
            Access = Permissions.Basic;
        }
 public CreateSomeDataCommand(Guid id,
                              string firstName,
                              string middleName,
                              string lastName,
                              string title,
                              Color color,
                              DateTime creationDate,
                              FacebookUrl facebookUrl,
                              ApplicationUserId applicationUserId)
 {
     Id                = id;
     FirstName         = firstName;
     MiddleName        = middleName;
     LastName          = lastName;
     Title             = title;
     Color             = color;
     CreationDate      = creationDate;
     FacebookUrl       = facebookUrl;
     ApplicationUserId = applicationUserId;
 }
Exemplo n.º 4
0
 public bool CheckUserAdmin(ApplicationUser user)
 {
     return(ApplicationUserId.Equals(user.Id));
 }
 public BusinessUser GetByApplicationUserId(ApplicationUserId id, SomeDataContext dbContext)
 {
     return(dbContext.BusinessUsers.FirstOrDefault(u => u.IdentityId == id.Value));
 }