public void UpdateInstruction(WhatYouGotLibrary.Models.Instruction instruction) { Entities.Instruction currentInstruction = _context.Instruction.Find(instruction.Id); Entities.Instruction newInstruction = Mapper.Map(instruction); _context.Entry(currentInstruction).CurrentValues.SetValues(newInstruction); }
public static Entities.Instruction Map(WhatYouGotLibrary.Models.Instruction instruction) { return(new Entities.Instruction { Id = instruction.Id, RecipeId = instruction.RecipeId, StepNumber = instruction.StepNumber, StepDescription = instruction.StepDescription }); }
public void AddInstruction(WhatYouGotLibrary.Models.Instruction instruction) { Entities.Instruction newInstruction = Mapper.Map(instruction); _context.Add(newInstruction); }