Exemplo n.º 1
0
        private async Task CreateProfilePropertyInDb(UserProfileProperty userProfileProperty, ProfilePropertyVisibility visibility)
        {
            using (var uow = new UnitOfWork(Context))
            {
                var repo = new UserProfilePropertyRepository(uow);

                await repo.CreateWithData(userProfileProperty, visibility);
            }
        }
Exemplo n.º 2
0
        public async Task <UserProfileProperty> CreateWithData(UserProfileProperty entity, ProfilePropertyVisibility visibility)
        {
            var dbRecord = new UserProfile
            {
                UserId = entity.UserId,
                PropertyDefinitionId = entity.ProfilePropertyId,
                PropertyValue        = entity.Value,
                LastUpdatedDate      = DateTime.UtcNow,
                Visibility           = (int)visibility
            };

            Uow.DbContext.UserProfile.Add(dbRecord);

            await Uow.SaveChanges();

            return(Translate(dbRecord));
        }