Exemplo n.º 1
0
        public void Update(DalPhoto entity)
        {
            var filter = Builders <Photo> .Filter.Eq(u => u.Id, entity.Id);

            modelContext.Photos.ReplaceOne(filter, entity.ToOrmPhoto(), new UpdateOptions()
            {
                IsUpsert = true
            });
        }
 public void Create(DalPhoto entity)
 {
     context.Set <Photo>().Add(entity.ToOrmPhoto());
 }
Exemplo n.º 3
0
 public void Insert(DalPhoto entity)
 {
     entity.Id = GetId() + 1;
     modelContext.Photos.InsertOne(entity.ToOrmPhoto());
 }
Exemplo n.º 4
0
 public void Create(DalPhoto dalPhoto)
 {
     context.Set <Photo>()
     .Add(dalPhoto.ToOrmPhoto());
 }