示例#1
0
 private static Profile ToDomain(ProfileEntity entity)
 {
     return(new Profile(
                entity.Id.ToString(),
                entity.FirstName,
                entity.LastName,
                entity.Gender,
                entity.DateOfBirth,
                entity.City));
 }
示例#2
0
        public async Task <string> InsertAsync(Profile profile)
        {
            var profileEntity = new ProfileEntity
            {
                City        = profile.City,
                DateOfBirth = profile.DateOfBirth,
                FirstName   = profile.FirstName,
                LastName    = profile.LastName,
                Gender      = profile.Gender
            };

            await context.AddAsync(profileEntity);

            await context.SaveChangesAsync();

            return(profileEntity.Id.ToString());
        }