Example #1
0
 public void Create(Common.Models.Recipe recipe)
 {
     using (var client = GetClient())
     {
         client.CreateDocumentAsync(GetCollection().DocumentsLink, recipe).Wait();
     }
 }
Example #2
0
 public void Edit(Common.Models.Recipe recipe)
 {
     using (var client = GetClient())
     {
         var item = client.CreateDocumentQuery(GetCollection().DocumentsLink).Where(x => x.Id == recipe.Id.ToString())
                    .AsEnumerable()
                    .FirstOrDefault();
         client.ReplaceDocumentAsync(item.SelfLink, recipe).Wait();
     }
 }
Example #3
0
 public void Edit(Common.Models.Recipe recipe)
 {
     _dataContext.Entry(recipe).State = System.Data.Entity.EntityState.Modified;
     _dataContext.SaveChanges();
 }
Example #4
0
 public void Create(Common.Models.Recipe recipe)
 {
     _dataContext.Recipes.Add(recipe);
     _dataContext.SaveChanges();
 }