// POST: api/Reciepe public void Post([FromBody] Receipe value) { using (MongoRepository _repository = new MongoRepository()) { DbReceipe result =_repository.RetrieveLastInserted<DbReceipe>("Reciepe","ReciepeID"); DbReceipe document = new DbReceipe((result.ReciepeID + 1),value.ReceipeTypeID,value.Name,value.Ingredients,value.Instructions,value.CookingTime,value.PreparationTime,value.IsHealthy,value.IsDiabetic,false,value.ImageUrl); _repository.InsertCollection<DbReceipe>("Reciepe", document); } }
//// GET: api/AvaliableList/5 //public string Get(int id) //{ // return "value"; //} // POST: api/AvaliableList public void Post([FromBody] string value) { using (MongoRepository _repository = new MongoRepository()) { DbReceipeType result = _repository.RetrieveLastInserted<DbReceipeType>("ReciepeType", "ReciepeID"); DbReceipeType document = new DbReceipeType((result.ReciepeID + 1), value); _repository.InsertCollection<DbReceipeType>("ReciepeType", document); } }