コード例 #1
0
        public void CreateProperty(PropertyEntitiy property)
        {
            _context.Entry(property).State = EntityState.Modified;
            _context.Properties.Add(property);

            _context.SaveChanges();
        }
コード例 #2
0
 public static void PopulatePhotostring(this PropertyEntitiy property)
 {
     if (property.PhotosCollection != null)
     {
         foreach (var photo in property.PhotosCollection)
         {
             property.Photos.Add(photo.Url);
         }
     }
 }
コード例 #3
0
 public static void InitialiseJson(this PropertyEntitiy property)
 {
     if (property.Photos != null)
     {
         foreach (var photo in property.Photos)
         {
             property.PhotosCollection.Add(new PhotoEntity {
                 Url = photo
             });
         }
     }
 }
コード例 #4
0
        public void UpdateProperty(PropertyEntitiy property)
        {
            if (!PropertyExists(property.Id))
            {
                return;
            }
            _context.Properties.Add(property);

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
            }
        }