示例#1
0
        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
     });
 }
示例#3
0
 public void AddInstruction(WhatYouGotLibrary.Models.Instruction instruction)
 {
     Entities.Instruction newInstruction = Mapper.Map(instruction);
     _context.Add(newInstruction);
 }